From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Sun, 14 May 2023 11:37:58 +0000 (+1000) Subject: Prevent early salvage FTL (#16409) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=ed297e9d469a9221db1745885de40e96e86d1c19;p=space-station-14.git Prevent early salvage FTL (#16409) --- diff --git a/Content.Client/Shuttles/BUI/ShuttleConsoleBoundUserInterface.cs b/Content.Client/Shuttles/BUI/ShuttleConsoleBoundUserInterface.cs index b67664020e..8328dbe5f9 100644 --- a/Content.Client/Shuttles/BUI/ShuttleConsoleBoundUserInterface.cs +++ b/Content.Client/Shuttles/BUI/ShuttleConsoleBoundUserInterface.cs @@ -28,7 +28,7 @@ public sealed class ShuttleConsoleBoundUserInterface : BoundUserInterface private void OnDestinationPressed(EntityUid obj) { - SendMessage(new ShuttleConsoleDestinationMessage() + SendMessage(new ShuttleConsoleFTLRequestMessage() { Destination = obj, }); diff --git a/Content.Server/Salvage/SalvageSystem.Runner.cs b/Content.Server/Salvage/SalvageSystem.Runner.cs index f40ed4ed22..710fb9f84e 100644 --- a/Content.Server/Salvage/SalvageSystem.Runner.cs +++ b/Content.Server/Salvage/SalvageSystem.Runner.cs @@ -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(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(ev.Entity); + // Check if any shuttles remain. var query = EntityQueryEnumerator(); diff --git a/Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs b/Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs index cce035dca5..2b96f9d13f 100644 --- a/Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs +++ b/Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs @@ -39,7 +39,7 @@ public sealed class ShuttleConsoleSystem : SharedShuttleConsoleSystem SubscribeLocalEvent(OnConsolePowerChange); SubscribeLocalEvent(OnConsoleAnchorChange); SubscribeLocalEvent(OnConsoleUIOpenAttempt); - SubscribeLocalEvent(OnDestinationMessage); + SubscribeLocalEvent(OnDestinationMessage); SubscribeLocalEvent(OnConsoleUIClose); SubscribeLocalEvent(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(args.Destination, out var dest)) { diff --git a/Content.Shared/Shuttles/Events/ShuttleConsoleDestinationMessage.cs b/Content.Shared/Shuttles/Events/ShuttleConsoleFTLRequestMessage.cs similarity index 74% rename from Content.Shared/Shuttles/Events/ShuttleConsoleDestinationMessage.cs rename to Content.Shared/Shuttles/Events/ShuttleConsoleFTLRequestMessage.cs index 662d6079cf..e1aac65ea3 100644 --- a/Content.Shared/Shuttles/Events/ShuttleConsoleDestinationMessage.cs +++ b/Content.Shared/Shuttles/Events/ShuttleConsoleFTLRequestMessage.cs @@ -6,7 +6,7 @@ namespace Content.Shared.Shuttles.Events; /// Raised on the client when it wishes to travel somewhere. /// [Serializable, NetSerializable] -public sealed class ShuttleConsoleDestinationMessage : BoundUserInterfaceMessage +public sealed class ShuttleConsoleFTLRequestMessage : BoundUserInterfaceMessage { public EntityUid Destination; }