diff --git a/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs b/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs index b32d50a065..b3e4742904 100644 --- a/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs +++ b/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs @@ -460,13 +460,22 @@ public sealed partial class ShuttleSystem var xformQuery = GetEntityQuery(); var shuttleAABB = Comp(component.Owner).LocalAABB; + Box2 targetLocalAABB; // Spawn nearby. // We essentially expand the Box2 of the target area until nothing else is added then we know it's valid. // Can't just get an AABB of every grid as we may spawn very far away. - var targetAABB = _transform.GetWorldMatrix(targetXform, xformQuery) - .TransformBox(Comp(targetUid).LocalAABB).Enlarged(shuttleAABB.Size.Length); + if (TryComp(targetUid, out var targetGrid)) + { + targetLocalAABB = targetGrid.LocalAABB; + } + else + { + targetLocalAABB = new Box2(); + } + var targetAABB = _transform.GetWorldMatrix(targetXform, xformQuery) + .TransformBox(targetLocalAABB).Enlarged(shuttleAABB.Size.Length); var nearbyGrids = new HashSet(1) { targetUid }; var iteration = 0; var lastCount = 1; diff --git a/Resources/Prototypes/Entities/Markers/shuttle.yml b/Resources/Prototypes/Entities/Markers/shuttle.yml new file mode 100644 index 0000000000..9ef9c0de5a --- /dev/null +++ b/Resources/Prototypes/Entities/Markers/shuttle.yml @@ -0,0 +1,8 @@ +- type: entity + id: FTLPoint + parent: MarkerBase + name: FTL point + components: + - type: FTLDestination + - type: Sprite + state: pink