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
@@ -38,7 +38,7 @@ public sealed partial class ExplosionSystem
private void OnGridRemoved(GridRemovalEvent ev)
{
_airtightMap.Remove(ev.EntityUid);
OnAirtightGridRemoved(ev.EntityUid);
_gridEdges.Remove(ev.EntityUid);
// this should be a small enough set that iterating all of them is fine