|
|
|
@ -528,8 +528,15 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
if (cityObject.warehouse != null) { |
|
|
|
if (cityObject.warehouse != null) { |
|
|
|
PlaceAssetMsg.sendPlaceAssetError(origin, 50, ""); //"You can only have one warehouse"
|
|
|
|
if(cityObject.warehouse.building != null) { |
|
|
|
return false; |
|
|
|
//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
|
|
|
|
// Create the warehouse object and it's entry in the database
|
|
|
|
|