Make atmos debug overlay system data clear on round restart (#2558)

This commit is contained in:
DrSmugleaf
2020-11-15 04:16:02 +01:00
committed by GitHub
parent 2ded2163fe
commit b1a7aef97d

View File

@@ -4,6 +4,7 @@ using System.Collections.Generic;
using Content.Client.Atmos; using Content.Client.Atmos;
using Content.Shared.Atmos; using Content.Shared.Atmos;
using Content.Shared.GameObjects.EntitySystems.Atmos; using Content.Shared.GameObjects.EntitySystems.Atmos;
using Content.Shared.GameTicking;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Client.Graphics; using Robust.Client.Graphics;
using Robust.Client.Interfaces.Graphics.Overlays; using Robust.Client.Interfaces.Graphics.Overlays;
@@ -19,7 +20,7 @@ using Robust.Shared.Utility;
namespace Content.Client.GameObjects.EntitySystems namespace Content.Client.GameObjects.EntitySystems
{ {
[UsedImplicitly] [UsedImplicitly]
internal sealed class AtmosDebugOverlaySystem : SharedAtmosDebugOverlaySystem internal sealed class AtmosDebugOverlaySystem : SharedAtmosDebugOverlaySystem, IResettingEntitySystem
{ {
[Dependency] private readonly IMapManager _mapManager = default!; [Dependency] private readonly IMapManager _mapManager = default!;
@@ -55,6 +56,11 @@ namespace Content.Client.GameObjects.EntitySystems
overlayManager.RemoveOverlay(nameof(GasTileOverlay)); overlayManager.RemoveOverlay(nameof(GasTileOverlay));
} }
public void Reset()
{
_tileData.Clear();
}
private void OnGridRemoved(GridId gridId) private void OnGridRemoved(GridId gridId)
{ {
if (_tileData.ContainsKey(gridId)) if (_tileData.ContainsKey(gridId))