[HOTFIX] Movement Rewrite Hotfix Shuttles now respect their friction values (#37154)

* Shuttles now use their proper friction values

* Documentation

* Shuttles now use their proper friction values

* Documentation

* What the instrumentsystem doin

* what the instrumentsystem doing 2
This commit is contained in:
Princess Cheeseballs
2025-05-13 05:14:18 -07:00
committed by GitHub
parent 45253ca79e
commit 61adee05f6
4 changed files with 32 additions and 11 deletions

View File

@@ -4,10 +4,12 @@ using Content.Server.Doors.Systems;
using Content.Server.Parallax;
using Content.Server.Procedural;
using Content.Server.Shuttles.Components;
using Content.Server.Shuttles.Events;
using Content.Server.Station.Systems;
using Content.Server.Stunnable;
using Content.Shared.GameTicking;
using Content.Shared.Mobs.Systems;
using Content.Shared.Movement.Events;
using Content.Shared.Salvage;
using Content.Shared.Shuttles.Systems;
using Content.Shared.Throwing;
@@ -78,6 +80,9 @@ public sealed partial class ShuttleSystem : SharedShuttleSystem
SubscribeLocalEvent<ShuttleComponent, ComponentStartup>(OnShuttleStartup);
SubscribeLocalEvent<ShuttleComponent, ComponentShutdown>(OnShuttleShutdown);
SubscribeLocalEvent<ShuttleComponent, TileFrictionEvent>(OnTileFriction);
SubscribeLocalEvent<ShuttleComponent, FTLStartedEvent>(OnFTLStarted);
SubscribeLocalEvent<ShuttleComponent, FTLCompletedEvent>(OnFTLCompleted);
SubscribeLocalEvent<GridInitializeEvent>(OnGridInit);
SubscribeLocalEvent<FixturesComponent, GridFixtureChangeEvent>(OnGridFixtureChange);
@@ -122,6 +127,8 @@ public sealed partial class ShuttleSystem : SharedShuttleSystem
{
Enable(uid, component: physicsComponent, shuttle: component);
}
component.DampingModifier = component.BodyModifier;
}
public void Toggle(EntityUid uid, ShuttleComponent component)
@@ -149,8 +156,6 @@ public sealed partial class ShuttleSystem : SharedShuttleSystem
_physics.SetBodyType(uid, BodyType.Dynamic, manager: manager, body: component);
_physics.SetBodyStatus(uid, component, BodyStatus.InAir);
_physics.SetFixedRotation(uid, false, manager: manager, body: component);
_physics.SetLinearDamping(uid, component, shuttle.LinearDamping);
_physics.SetAngularDamping(uid, component, shuttle.AngularDamping);
}
public void Disable(EntityUid uid, FixturesComponent? manager = null, PhysicsComponent? component = null)
@@ -171,4 +176,19 @@ public sealed partial class ShuttleSystem : SharedShuttleSystem
Disable(uid);
}
private void OnTileFriction(Entity<ShuttleComponent> ent, ref TileFrictionEvent args)
{
args.Modifier *= ent.Comp.DampingModifier;
}
private void OnFTLStarted(Entity<ShuttleComponent> ent, ref FTLStartedEvent args)
{
ent.Comp.DampingModifier = 0f;
}
private void OnFTLCompleted(Entity<ShuttleComponent> ent, ref FTLCompletedEvent args)
{
ent.Comp.DampingModifier = ent.Comp.BodyModifier;
}
}