Fix cargo FTL (#15557)

This commit is contained in:
metalgearsloth
2023-04-20 13:28:19 +10:00
committed by GitHub
parent 8970bd3cb5
commit 7cd7b5091c

View File

@@ -503,7 +503,6 @@ public sealed partial class ShuttleSystem
public bool TryFTLProximity(EntityUid shuttleUid, ShuttleComponent component, EntityUid targetUid, TransformComponent? xform = null, TransformComponent? targetXform = null) public bool TryFTLProximity(EntityUid shuttleUid, ShuttleComponent component, EntityUid targetUid, TransformComponent? xform = null, TransformComponent? targetXform = null)
{ {
if (!Resolve(targetUid, ref targetXform) || if (!Resolve(targetUid, ref targetXform) ||
targetXform.GridUid == null ||
targetXform.MapUid == null || targetXform.MapUid == null ||
!targetXform.MapUid.Value.IsValid() || !targetXform.MapUid.Value.IsValid() ||
!Resolve(shuttleUid, ref xform)) !Resolve(shuttleUid, ref xform))
@@ -598,7 +597,7 @@ public sealed partial class ShuttleSystem
} }
// TODO: This is pretty crude for multiple landings. // TODO: This is pretty crude for multiple landings.
if (nearbyGrids.Count > 1 || !HasComp<MapComponent>(targetXform.GridUid.Value)) if (nearbyGrids.Count > 1 || !HasComp<MapComponent>(targetXform.GridUid))
{ {
var minRadius = (MathF.Max(targetAABB.Width, targetAABB.Height) + MathF.Max(shuttleAABB.Width, shuttleAABB.Height)) / 2f; var minRadius = (MathF.Max(targetAABB.Width, targetAABB.Height) + MathF.Max(shuttleAABB.Width, shuttleAABB.Height)) / 2f;
spawnPos = targetAABB.Center + _random.NextVector2(minRadius, minRadius + 64f); spawnPos = targetAABB.Center + _random.NextVector2(minRadius, minRadius + 64f);