]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
allow shuttle to Scan for Objects while FTL is on cooldown (#42283)
authorCharlie Morley <cmorley191@gmail.com>
Wed, 14 Jan 2026 21:38:19 +0000 (13:38 -0800)
committerGitHub <noreply@github.com>
Wed, 14 Jan 2026 21:38:19 +0000 (21:38 +0000)
* allow shuttle to Scan for Objects while FTL is on cooldown

* cleanup

---------

Co-authored-by: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com>
Content.Client/Shuttles/UI/MapScreen.xaml.cs

index 72ad3c28b1d19a8e8155f9202934f7cc0a6a248b..ff55c0b46200efe350b5a807bee480257055f646 100644 (file)
@@ -153,7 +153,7 @@ public sealed partial class MapScreen : BoxContainer
                 break;
         }
 
-        if (IsFTLBlocked())
+        if (IsPingBlocked())
         {
             MapRebuildButton.Disabled = true;
             ClearMapObjects();
@@ -408,9 +408,21 @@ public sealed partial class MapScreen : BoxContainer
         }
     }
 
+    /// <summary>
+    /// Returns true if we shouldn't be able to select the Scan for Objects button.
+    /// </summary>
+    private bool IsPingBlocked()
+    {
+        return _state switch
+        {
+            FTLState.Available or FTLState.Cooldown => false,
+            _ => true,
+        };
+    }
+
     private void OnMapObjectPress(IMapObject mapObject)
     {
-        if (IsFTLBlocked())
+        if (IsPingBlocked())
             return;
 
         var coordinates = _shuttles.GetMapCoordinates(mapObject);
@@ -506,7 +518,7 @@ public sealed partial class MapScreen : BoxContainer
             BumpMapDequeue();
         }
 
-        if (!IsFTLBlocked() && _nextPing < curTime)
+        if (!IsPingBlocked() && _nextPing < curTime)
         {
             MapRebuildButton.Disabled = false;
         }