Skip to content

Commit

Permalink
Cherry-picked commit 02cc9c0 from space-wizards/space-station-14/master
Browse files Browse the repository at this point in the history
  • Loading branch information
metalgearsloth authored and SimpleStation14 committed Apr 21, 2024
1 parent 3bf08c7 commit 7cd3dc1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,9 @@ private void OnEmergencyAuthorize(EntityUid uid, EmergencyShuttleConsoleComponen

private void CleanupEmergencyConsole()
{
// Realistically most of this shit needs moving to a station component so each station has their own emergency shuttle
// and timer and all that jazz so I don't really care about debugging if it works on cleanup vs start.
_announced = false;
_roundEndCancelToken = null;
ShuttlesLeft = false;
_launchedShuttles = false;
_consoleAccumulator = float.MinValue;
Expand Down
9 changes: 8 additions & 1 deletion Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using Content.Shared.CCVar;
using Content.Shared.Database;
using Content.Shared.DeviceNetwork;
using Content.Shared.GameTicking;
using Content.Shared.Shuttles.Components;
using Content.Shared.Shuttles.Events;
using Content.Shared.Tag;
Expand Down Expand Up @@ -80,6 +81,7 @@ public override void Initialize()
Subs.CVar(_configManager, CCVars.EmergencyShuttleEnabled, SetEmergencyShuttleEnabled);

SubscribeLocalEvent<RoundStartingEvent>(OnRoundStart);
SubscribeLocalEvent<RoundRestartCleanupEvent>(OnRoundCleanup);
SubscribeLocalEvent<StationEmergencyShuttleComponent, ComponentStartup>(OnStationStartup);
SubscribeLocalEvent<StationCentcommComponent, ComponentShutdown>(OnCentcommShutdown);
SubscribeLocalEvent<StationCentcommComponent, ComponentInit>(OnCentcommInit);
Expand All @@ -93,10 +95,15 @@ public override void Initialize()
private void OnRoundStart(RoundStartingEvent ev)
{
CleanupEmergencyConsole();
_roundEndCancelToken?.Cancel();
_roundEndCancelToken = new CancellationTokenSource();
}

private void OnRoundCleanup(RoundRestartCleanupEvent ev)
{
_roundEndCancelToken?.Cancel();
_roundEndCancelToken = null;
}

private void OnCentcommShutdown(EntityUid uid, StationCentcommComponent component, ComponentShutdown args)
{
ClearCentcomm(component);
Expand Down

0 comments on commit 7cd3dc1

Please sign in to comment.