From 4b2a4dbfb73ebbc465679b57c1e0a2d831d52987 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Mon, 20 Sep 2021 21:08:10 +1000 Subject: [PATCH] Update content for accurate grid bounds (#4632) * A * dummy comment why CI plz --- Content.Server/Shuttles/ShuttleSystem.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Content.Server/Shuttles/ShuttleSystem.cs b/Content.Server/Shuttles/ShuttleSystem.cs index 8479d00148..576e272506 100644 --- a/Content.Server/Shuttles/ShuttleSystem.cs +++ b/Content.Server/Shuttles/ShuttleSystem.cs @@ -26,16 +26,21 @@ namespace Content.Server.Shuttles private void HandleGridFixtureChange(GridFixtureChangeEvent args) { - var fixture = args.NewFixture; + // Look this is jank but it's a placeholder until we design it. + if (args.NewFixtures.Count == 0) return; - if (fixture == null) return; + var body = args.NewFixtures[0].Body; - fixture.Mass = fixture.Area * TileMassMultiplier; - - if (fixture.Body.Owner.TryGetComponent(out ShuttleComponent? shuttleComponent)) + foreach (var fixture in args.NewFixtures) { - RecalculateSpeedMultiplier(shuttleComponent, fixture.Body); + fixture.Mass = fixture.Area * TileMassMultiplier; } + + if (body.Owner.TryGetComponent(out ShuttleComponent? shuttleComponent)) + { + RecalculateSpeedMultiplier(shuttleComponent, body); + } + } private void HandleGridInit(GridInitializeEvent ev)