]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix rounds restarting in the next round (#25856)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Tue, 12 Mar 2024 18:54:28 +0000 (05:54 +1100)
committerGitHub <noreply@github.com>
Tue, 12 Mar 2024 18:54:28 +0000 (14:54 -0400)
* Fix rounds restarting in the next round

Doesn't fix them restarting in lobby I think but should fix most of it.

* delta india sierra charlie oscar romeo delta

Content.Server/Shuttles/Systems/EmergencyShuttleSystem.Console.cs
Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs

index 6d2c28edcfcde579dba1c525cee78a0100092e5c..aeb2ebdbba13cc4c24655a78a6ae159df9855eef 100644 (file)
@@ -308,8 +308,9 @@ public sealed partial class EmergencyShuttleSystem
 
     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;
index a7df41d887720419706f709fc4784f9b96fcc6df..47aad6a60361a774ea12bd02a48804bfc57c0933 100644 (file)
@@ -19,6 +19,7 @@ using Content.Shared.Access.Systems;
 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;
@@ -80,6 +81,7 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem
         Subs.CVar(_configManager, CCVars.EmergencyShuttleEnabled, SetEmergencyShuttleEnabled);
 
         SubscribeLocalEvent<RoundStartingEvent>(OnRoundStart);
+        SubscribeLocalEvent<RoundRestartCleanupEvent>(OnRoundCleanup);
         SubscribeLocalEvent<StationEmergencyShuttleComponent, ComponentStartup>(OnStationStartup);
         SubscribeLocalEvent<StationCentcommComponent, ComponentShutdown>(OnCentcommShutdown);
         SubscribeLocalEvent<StationCentcommComponent, ComponentInit>(OnCentcommInit);
@@ -93,10 +95,15 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem
     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);