Make sure explosions reset on round restart (#7801)

This commit is contained in:
Leon Friedrich
2022-04-27 02:37:31 +12:00
committed by GitHub
parent f1385b1352
commit d3a20c8a23
2 changed files with 28 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ using Content.Shared.Camera;
using Content.Shared.Damage;
using Content.Shared.Database;
using Content.Shared.Explosion;
using Content.Shared.GameTicking;
using Content.Shared.Throwing;
using Robust.Server.Containers;
using Robust.Server.Player;
@@ -67,6 +68,8 @@ public sealed partial class ExplosionSystem : EntitySystem
SubscribeLocalEvent<ExplosionResistanceComponent, GetExplosionResistanceEvent>(OnGetResistance);
SubscribeLocalEvent<TileChangedEvent>(OnTileChanged);
SubscribeLocalEvent<RoundRestartCleanupEvent>(OnReset);
// Handled by ExplosionSystem.Processing.cs
SubscribeLocalEvent<MapChangedEvent>(OnMapChanged);
@@ -76,10 +79,18 @@ public sealed partial class ExplosionSystem : EntitySystem
InitAirtightMap();
}
private void OnReset(RoundRestartCleanupEvent ev)
{
_explosionQueue.Clear();
_activeExplosion = null;
_nodeGroupSystem.Snoozing = false;
}
public override void Shutdown()
{
base.Shutdown();
UnsubscribeCvars();
_nodeGroupSystem.Snoozing = false;
}
private void OnGetResistance(EntityUid uid, ExplosionResistanceComponent component, GetExplosionResistanceEvent args)