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:
1 parent
0865a7be74
commit
e64d64bf18
6 files changed
+12
-16
No files matched your search
@@ -211,12 +211,7 @@ public enum BuildingManager {
|
||||
break;
|
||||
case WAREHOUSE:
|
||||
|
||||
City city = building.getCity();
|
||||
|
||||
if (city == null)
|
||||
return true;
|
||||
|
||||
Warehouse warehouse = city.warehouse;
|
||||
Warehouse warehouse = Warehouse.destroyedWarehouses.get(building.getObjectUUID());
|
||||
|
||||
if (warehouse == null)
|
||||
return false;
|
||||
@@ -241,6 +236,9 @@ public enum BuildingManager {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (Warehouse.isEmpty(warehouse))
|
||||
Warehouse.destroyedWarehouses.remove(building.getObjectUUID());
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user