manual WH cleanup when WH exists but building doesn't

This commit is contained in:
2025-11-01 20:44:49 -05:00
parent 8b4619f6ae
commit fa2dd72798
@@ -528,8 +528,15 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
return false;
if (cityObject.warehouse != null) {
PlaceAssetMsg.sendPlaceAssetError(origin, 50, ""); //"You can only have one warehouse"
return false;
if(cityObject.warehouse.building != null) {
//warehosue has a building already, warehouse still should exist
PlaceAssetMsg.sendPlaceAssetError(origin, 50, ""); //"You can only have one warehouse"
return false;
}else{
//warehouse has no building and needs a cleanup
DbManager.WarehouseQueries.DELETE_WAREHOUSE(cityObject.warehouse);
cityObject.warehouse = null;
}
}
// Create the warehouse object and it's entry in the database