Reduce explosion airtight cache memory usage (#40912)

* Reduce explosion airtight cache memory usage

This means you can happily add explosion prototypes again

New approach has the tolerance value data in a shared storage with reference counting.

* Oops fix index removal

* Remove debug code and fix merge conflicts

* Also address my other review

* Oh it's in two places lmao

---------

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
This commit is contained in:
Pieter-Jan Briers
2026-04-04 16:54:51 +02:00
committed by BarryNorfolk
co-authored by Princess Cheeseballs
parent 538a1b1839
commit 9dd9f5cd92
7 changed files with 282 additions and 82 deletions
@@ -106,6 +106,8 @@ public sealed partial class ExplosionSystem : SharedExplosionSystem
_destructibleQuery = GetEntityQuery<DestructibleComponent>();
_damageableQuery = GetEntityQuery<DamageableComponent>();
_airtightQuery = GetEntityQuery<AirtightComponent>();
_prototypeManager.PrototypesReloaded += ReloadExplosionPrototypes;
}
private void OnReset(RoundRestartCleanupEvent ev)
@@ -124,6 +126,7 @@ public sealed partial class ExplosionSystem : SharedExplosionSystem
base.Shutdown();
_nodeGroupSystem.PauseUpdating = false;
_pathfindingSystem.PauseUpdating = false;
_prototypeManager.PrototypesReloaded -= ReloadExplosionPrototypes;
}
private void RelayedResistance(EntityUid uid, ExplosionResistanceComponent component,