]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Prevent early salvage FTL (#16409)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Sun, 14 May 2023 11:37:58 +0000 (21:37 +1000)
committerGitHub <noreply@github.com>
Sun, 14 May 2023 11:37:58 +0000 (07:37 -0400)
Content.Client/Shuttles/BUI/ShuttleConsoleBoundUserInterface.cs
Content.Server/Salvage/SalvageSystem.Runner.cs
Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs
Content.Shared/Shuttles/Events/ShuttleConsoleFTLRequestMessage.cs [moved from Content.Shared/Shuttles/Events/ShuttleConsoleDestinationMessage.cs with 74% similarity]

index b67664020ec324feac9df5d69786bbe822a610df..8328dbe5f901b56dd1f369494f33edec691650b1 100644 (file)
@@ -28,7 +28,7 @@ public sealed class ShuttleConsoleBoundUserInterface : BoundUserInterface
 
     private void OnDestinationPressed(EntityUid obj)
     {
-        SendMessage(new ShuttleConsoleDestinationMessage()
+        SendMessage(new ShuttleConsoleFTLRequestMessage()
         {
             Destination = obj,
         });
index f40ed4ed22c5bd9321e21f9dc731ea9052d6b560..710fb9f84e77dccaa8ecac4214669b325a8ee20e 100644 (file)
@@ -6,6 +6,7 @@ using Content.Server.Shuttles.Systems;
 using Content.Server.Station.Components;
 using Content.Shared.Chat;
 using Content.Shared.Salvage;
+using Content.Shared.Shuttles.Components;
 using Robust.Shared.Audio;
 using Robust.Shared.Map.Components;
 using Robust.Shared.Player;
@@ -73,6 +74,8 @@ public sealed partial class SalvageSystem
             Announce(args.MapUid, Loc.GetString("salvage-expedition-announcement-dungeon", ("direction", component.DungeonLocation.GetDir())));
 
         component.Stage = ExpeditionStage.Running;
+        // At least for now stop them FTLing back until the mission is over.
+        EnsureComp<PreventPilotComponent>(args.Entity);
     }
 
     private void OnFTLStarted(ref FTLStartedEvent ev)
@@ -94,6 +97,9 @@ public sealed partial class SalvageSystem
             return;
         }
 
+        // Let them pilot again when they get back.
+        RemCompDeferred<PreventPilotComponent>(ev.Entity);
+
         // Check if any shuttles remain.
         var query = EntityQueryEnumerator<ShuttleComponent, TransformComponent>();
 
index cce035dca50d031c5fbaaceee8cf66d310ac1744..2b96f9d13fb632396d35f03e5737b0f47d356eb5 100644 (file)
@@ -39,7 +39,7 @@ public sealed class ShuttleConsoleSystem : SharedShuttleConsoleSystem
         SubscribeLocalEvent<ShuttleConsoleComponent, PowerChangedEvent>(OnConsolePowerChange);
         SubscribeLocalEvent<ShuttleConsoleComponent, AnchorStateChangedEvent>(OnConsoleAnchorChange);
         SubscribeLocalEvent<ShuttleConsoleComponent, ActivatableUIOpenAttemptEvent>(OnConsoleUIOpenAttempt);
-        SubscribeLocalEvent<ShuttleConsoleComponent, ShuttleConsoleDestinationMessage>(OnDestinationMessage);
+        SubscribeLocalEvent<ShuttleConsoleComponent, ShuttleConsoleFTLRequestMessage>(OnDestinationMessage);
         SubscribeLocalEvent<ShuttleConsoleComponent, BoundUIClosedEvent>(OnConsoleUIClose);
 
         SubscribeLocalEvent<DockEvent>(OnDock);
@@ -62,7 +62,7 @@ public sealed class ShuttleConsoleSystem : SharedShuttleConsoleSystem
         RefreshShuttleConsoles();
     }
 
-    private void OnDestinationMessage(EntityUid uid, ShuttleConsoleComponent component, ShuttleConsoleDestinationMessage args)
+    private void OnDestinationMessage(EntityUid uid, ShuttleConsoleComponent component, ShuttleConsoleFTLRequestMessage args)
     {
         if (!TryComp<FTLDestinationComponent>(args.Destination, out var dest))
         {
similarity index 74%
rename from Content.Shared/Shuttles/Events/ShuttleConsoleDestinationMessage.cs
rename to Content.Shared/Shuttles/Events/ShuttleConsoleFTLRequestMessage.cs
index 662d6079cf894db33f3c5c7111a04bfc1b83ded3..e1aac65ea3cf9eb49c96fb296d977a7999e1ec89 100644 (file)
@@ -6,7 +6,7 @@ namespace Content.Shared.Shuttles.Events;
 /// Raised on the client when it wishes to travel somewhere.
 /// </summary>
 [Serializable, NetSerializable]
-public sealed class ShuttleConsoleDestinationMessage : BoundUserInterfaceMessage
+public sealed class ShuttleConsoleFTLRequestMessage : BoundUserInterfaceMessage
 {
     public EntityUid Destination;
 }