Batches all queued explosion events so that large simultaneous blasts
are processed without blocking the main thread.
Key optimisations vs. the previous implementation:
Worker thread — character, vehicle, and construction damage math runs
off the main thread; the main thread only applies the resulting plan.
Construction deduplication — nearby construction entities are collected
once per chunk (not once per explosion), so the grid lookup cost is
O(unique_positions) rather than O(chunk_size).
Character AABB pre-filter — a bounding box covering all explosion
positions in the chunk prunes distant characters before sending to
the worker, keeping the postMessage payload small.
setImmediate chunking — yields the event loop between CHUNK_SIZE
batches so network I/O can interleave.
Deduplication — each entity is queued at most once per flush cycle.
Batches all queued explosion events so that large simultaneous blasts are processed without blocking the main thread.
Key optimisations vs. the previous implementation: