From dcbc094f945de24d6b5a422027b91b5015876035 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Fri, 24 Mar 2023 17:17:08 +1100 Subject: [PATCH] Remove bounds check for FTL (#14787) --- .../Systems/ShuttleSystem.FasterThanLight.cs | 25 +------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs b/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs index d613e51eb7..6da7c65580 100644 --- a/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs +++ b/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs @@ -82,7 +82,7 @@ public sealed partial class ShuttleSystem } } - public bool CanFTL(EntityUid? uid, [NotNullWhen(false)] out string? reason, TransformComponent? xform = null) + public bool CanFTL(EntityUid? uid, [NotNullWhen(false)] out string? reason) { if (HasComp(uid)) { @@ -91,29 +91,6 @@ public sealed partial class ShuttleSystem } reason = null; - - if (!TryComp(uid, out var grid) || - !Resolve(uid.Value, ref xform)) - { - return true; - } - - var bounds = _transform.GetWorldMatrix(xform).TransformBox(grid.LocalAABB).Enlarged(ShuttleFTLRange); - var bodyQuery = GetEntityQuery(); - - foreach (var other in _mapManager.FindGridsIntersecting(xform.MapID, bounds)) - { - if (uid == other.Owner || - !bodyQuery.TryGetComponent(other.Owner, out var body) || - body.Mass < ShuttleFTLMassThreshold) - { - continue; - } - - reason = Loc.GetString("shuttle-console-proximity"); - return false; - } - return true; } -- 2.51.2