]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix error when trying to get a state with deleted grid entity ids in ExplosionVisuals...
authorDrSmugleaf <DrSmugleaf@users.noreply.github.com>
Sat, 18 Nov 2023 19:02:45 +0000 (11:02 -0800)
committerGitHub <noreply@github.com>
Sat, 18 Nov 2023 19:02:45 +0000 (06:02 +1100)
Content.Server/Explosion/EntitySystems/ExplosionSystem.GridMap.cs

index 34028ab43502454f0ec085a8a06a46e56ec768c2..799489d7b4cd797ea8cdfb9ceda41aa0b8a480e5 100644 (file)
@@ -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<ExplosionVisualsComponent>();
+        while (query.MoveNext(out var visuals))
+        {
+            visuals.Tiles.Remove(ev.EntityUid);
+        }
     }
 
     /// <summary>