Keep destroyed warehouse contents in memory so the rubble can be looted

destroyOrDerank nulled city.warehouse on destruction, so the loot click
found no warehouse and returned silently. The destroyed Warehouse is now
held in Warehouse.destroyedWarehouses keyed by the rubble building UUID
until it is looted empty, the rubble is destroyed, or the city places a
new warehouse. Contents are not persisted across a reboot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
MagicBotandClaude Opus 5.5 committed 2026-10-18 09:19:40 -04:00
1 parent 0865a7be74
commit e64d64bf18
6 files changed
+12 -16

No files matched your search

@@ -1341,6 +1341,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
}
Warehouse warehouse = new Warehouse(warehouseBuilding);
Warehouse.destroyedWarehouses.values().removeIf(destroyed -> destroyed.city == city);
city.warehouse = warehouse;
DbManager.WarehouseQueries.UPDATE_WAREHOUSE(warehouse);