Fix rounds restarting in the next round (#25856)

* 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
This commit is contained in:
metalgearsloth
2024-03-13 05:54:28 +11:00
committed by GitHub
parent 680cf5fec1
commit 02cc9c05dd
2 changed files with 10 additions and 2 deletions

View 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);