Files
wwdpublic/Content.Server/Station/Systems/StationDampeningSystem.cs
neuPanda c2e063c3de Porting over My Cruise Control Code From Frontier (#1482)
porting over my cruise control code from frontier with some minor bug
fixes. also had to fuck with the passive dampening system because the
notsorobust toolbox has hurt its self in confusion

Description.

redid the port from frontier removing unnecessary complicated and
confusing content.
replaced hard coded values with cvars
patched issues with the passive dampener system causing dampener states
to reset
added regions to cvar file to make it easier to look threw
reverted text so that its more ship based, your not driving a car
this is my original work so re-licensed my work under my name rather
than frontier blanket who is licensed to use edit agpl3

🆑
- tweak: tweaked friction remover system
- fix: fixed inertia dampening system resetting or effecting the wrong
grid
- remove: Removed overcomplicated alterations

Co-authored-by: neuPanda <spainman0@yahoo.com>
(cherry picked from commit e389dffcdd74812cfc1c372aff8cbccd74dd24ee)
2025-01-14 02:12:04 +03:00

34 lines
1.4 KiB
C#

using Content.Server.Shuttles.Components;
using Content.Server.Station.Events;
using Content.Shared.Physics;
namespace Content.Server.Station.Systems;
public sealed class StationDampeningSystem : EntitySystem
{
public override void Initialize()
{
SubscribeLocalEvent<StationPostInitEvent>(OnInitStation);
}
private void OnInitStation(ref StationPostInitEvent ev)
{
foreach (var grid in ev.Station.Comp.Grids)
{
// If the station grid doesn't have defined dampening, give it a small dampening by default
// This will ensure cargo tech pros won't fling the station 1000 megaparsec away from the galaxy
if (!TryComp<PassiveDampeningComponent>(grid, out var dampening))
dampening = AddComp<PassiveDampeningComponent>(grid);
EntityManager.TryGetComponent(grid, out ShuttleComponent? shuttleComponent);
// PassiveDampeningComponent conflicts with shuttles cruise control a frontier QOL and is resetting dampeners causing issues.
// so if a station which shuttles have the station component too, then don't reset the physics to a near off state when it gets bumped
dampening.Enabled = true;
dampening.LinearDampening = shuttleComponent?.LinearDamping ?? 0.01f;
dampening.AngularDampening = shuttleComponent?.AngularDamping ?? 0.01f;
}
}
}