Add station anchors (#18697)

This commit is contained in:
Kevin Zheng
2023-08-05 02:24:24 -07:00
committed by GitHub
parent 011fa393ac
commit ba589dbf65
3 changed files with 25 additions and 15 deletions

View File

@@ -44,9 +44,6 @@ public sealed partial class ShuttleSystem : SharedShuttleSystem
public const float TileMassMultiplier = 0.5f;
public const float ShuttleLinearDamping = 0.05f;
public const float ShuttleAngularDamping = 0.05f;
public override void Initialize()
{
base.Initialize();
@@ -125,7 +122,7 @@ public sealed partial class ShuttleSystem : SharedShuttleSystem
if (component.Enabled)
{
Enable(uid, physicsComponent);
Enable(uid, physicsComponent, component);
}
}
@@ -138,7 +135,7 @@ public sealed partial class ShuttleSystem : SharedShuttleSystem
if (component.Enabled)
{
Enable(uid, physicsComponent);
Enable(uid, physicsComponent, component);
}
else
{
@@ -146,15 +143,15 @@ public sealed partial class ShuttleSystem : SharedShuttleSystem
}
}
private void Enable(EntityUid uid, PhysicsComponent component)
private void Enable(EntityUid uid, PhysicsComponent component, ShuttleComponent shuttle)
{
FixturesComponent? manager = null;
_physics.SetBodyType(uid, BodyType.Dynamic, manager: manager, body: component);
_physics.SetBodyStatus(component, BodyStatus.InAir);
_physics.SetFixedRotation(uid, false, manager: manager, body: component);
_physics.SetLinearDamping(component, ShuttleLinearDamping);
_physics.SetAngularDamping(component, ShuttleAngularDamping);
_physics.SetLinearDamping(component, shuttle.LinearDamping);
_physics.SetAngularDamping(component, shuttle.AngularDamping);
}
private void Disable(EntityUid uid, PhysicsComponent component)