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;
|
return false;
|
||||||
|
|
||||||
if (cityObject.warehouse != null) {
|
if (cityObject.warehouse != null) {
|
||||||
|
if(cityObject.warehouse.building != null) {
|
||||||
|
//warehosue has a building already, warehouse still should exist
|
||||||
PlaceAssetMsg.sendPlaceAssetError(origin, 50, ""); //"You can only have one warehouse"
|
PlaceAssetMsg.sendPlaceAssetError(origin, 50, ""); //"You can only have one warehouse"
|
||||||
return false;
|
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
|
// Create the warehouse object and it's entry in the database
|
||||||
|
|||||||
Reference in New Issue
Block a user