From 86c0a73c09bb835dc2db053718e911647d3b62a9 Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Sat, 18 Nov 2023 11:02:45 -0800 Subject: [PATCH] Fix error when trying to get a state with deleted grid entity ids in ExplosionVisualsComponent (#21743) --- .../Explosion/EntitySystems/ExplosionSystem.GridMap.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Content.Server/Explosion/EntitySystems/ExplosionSystem.GridMap.cs b/Content.Server/Explosion/EntitySystems/ExplosionSystem.GridMap.cs index 34028ab435..799489d7b4 100644 --- a/Content.Server/Explosion/EntitySystems/ExplosionSystem.GridMap.cs +++ b/Content.Server/Explosion/EntitySystems/ExplosionSystem.GridMap.cs @@ -1,5 +1,6 @@ using System.Numerics; using Content.Shared.Atmos; +using Content.Shared.Explosion; using Robust.Shared.Map; using Robust.Shared.Map.Components; @@ -37,6 +38,13 @@ public sealed partial class ExplosionSystem : EntitySystem { _airtightMap.Remove(ev.EntityUid); _gridEdges.Remove(ev.EntityUid); + + // this should be a small enough set that iterating all of them is fine + var query = EntityQueryEnumerator(); + while (query.MoveNext(out var visuals)) + { + visuals.Tiles.Remove(ev.EntityUid); + } } /// -- 2.51.2