Prevent early salvage FTL (#16409)

This commit is contained in:
metalgearsloth
2023-05-14 21:37:58 +10:00
committed by GitHub
parent 67bccd4b37
commit ed297e9d46
4 changed files with 10 additions and 4 deletions

View File

@@ -28,7 +28,7 @@ public sealed class ShuttleConsoleBoundUserInterface : BoundUserInterface
private void OnDestinationPressed(EntityUid obj) private void OnDestinationPressed(EntityUid obj)
{ {
SendMessage(new ShuttleConsoleDestinationMessage() SendMessage(new ShuttleConsoleFTLRequestMessage()
{ {
Destination = obj, Destination = obj,
}); });

View File

@@ -6,6 +6,7 @@ using Content.Server.Shuttles.Systems;
using Content.Server.Station.Components; using Content.Server.Station.Components;
using Content.Shared.Chat; using Content.Shared.Chat;
using Content.Shared.Salvage; using Content.Shared.Salvage;
using Content.Shared.Shuttles.Components;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.Map.Components; using Robust.Shared.Map.Components;
using Robust.Shared.Player; 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()))); Announce(args.MapUid, Loc.GetString("salvage-expedition-announcement-dungeon", ("direction", component.DungeonLocation.GetDir())));
component.Stage = ExpeditionStage.Running; 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) private void OnFTLStarted(ref FTLStartedEvent ev)
@@ -94,6 +97,9 @@ public sealed partial class SalvageSystem
return; return;
} }
// Let them pilot again when they get back.
RemCompDeferred<PreventPilotComponent>(ev.Entity);
// Check if any shuttles remain. // Check if any shuttles remain.
var query = EntityQueryEnumerator<ShuttleComponent, TransformComponent>(); var query = EntityQueryEnumerator<ShuttleComponent, TransformComponent>();

View File

@@ -39,7 +39,7 @@ public sealed class ShuttleConsoleSystem : SharedShuttleConsoleSystem
SubscribeLocalEvent<ShuttleConsoleComponent, PowerChangedEvent>(OnConsolePowerChange); SubscribeLocalEvent<ShuttleConsoleComponent, PowerChangedEvent>(OnConsolePowerChange);
SubscribeLocalEvent<ShuttleConsoleComponent, AnchorStateChangedEvent>(OnConsoleAnchorChange); SubscribeLocalEvent<ShuttleConsoleComponent, AnchorStateChangedEvent>(OnConsoleAnchorChange);
SubscribeLocalEvent<ShuttleConsoleComponent, ActivatableUIOpenAttemptEvent>(OnConsoleUIOpenAttempt); SubscribeLocalEvent<ShuttleConsoleComponent, ActivatableUIOpenAttemptEvent>(OnConsoleUIOpenAttempt);
SubscribeLocalEvent<ShuttleConsoleComponent, ShuttleConsoleDestinationMessage>(OnDestinationMessage); SubscribeLocalEvent<ShuttleConsoleComponent, ShuttleConsoleFTLRequestMessage>(OnDestinationMessage);
SubscribeLocalEvent<ShuttleConsoleComponent, BoundUIClosedEvent>(OnConsoleUIClose); SubscribeLocalEvent<ShuttleConsoleComponent, BoundUIClosedEvent>(OnConsoleUIClose);
SubscribeLocalEvent<DockEvent>(OnDock); SubscribeLocalEvent<DockEvent>(OnDock);
@@ -62,7 +62,7 @@ public sealed class ShuttleConsoleSystem : SharedShuttleConsoleSystem
RefreshShuttleConsoles(); 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)) if (!TryComp<FTLDestinationComponent>(args.Destination, out var dest))
{ {

View File

@@ -6,7 +6,7 @@ namespace Content.Shared.Shuttles.Events;
/// Raised on the client when it wishes to travel somewhere. /// Raised on the client when it wishes to travel somewhere.
/// </summary> /// </summary>
[Serializable, NetSerializable] [Serializable, NetSerializable]
public sealed class ShuttleConsoleDestinationMessage : BoundUserInterfaceMessage public sealed class ShuttleConsoleFTLRequestMessage : BoundUserInterfaceMessage
{ {
public EntityUid Destination; public EntityUid Destination;
} }