forked from MagicBane/Server
manual WH cleanup when WH exists but building doesn't
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user