]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Remove bounds check for FTL (#14787)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Fri, 24 Mar 2023 06:17:08 +0000 (17:17 +1100)
committerGitHub <noreply@github.com>
Fri, 24 Mar 2023 06:17:08 +0000 (17:17 +1100)
Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs

index d613e51eb74e78cd710b0742e0c23b3d26fa67b1..6da7c6558086f3b650af4f8d0c1232069d786340 100644 (file)
@@ -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<PreventPilotComponent>(uid))
         {
@@ -91,29 +91,6 @@ public sealed partial class ShuttleSystem
         }
 
         reason = null;
-
-        if (!TryComp<MapGridComponent>(uid, out var grid) ||
-            !Resolve(uid.Value, ref xform))
-        {
-            return true;
-        }
-
-        var bounds = _transform.GetWorldMatrix(xform).TransformBox(grid.LocalAABB).Enlarged(ShuttleFTLRange);
-        var bodyQuery = GetEntityQuery<PhysicsComponent>();
-
-        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;
     }