|
|
|
@ -123,13 +123,13 @@ CommandCost CmdBuildShipDepot(TileIndex tile, DoCommandFlag flags, uint32 p1, ui
|
|
|
|
|
CommandCost cost = CommandCost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_DEPOT_SHIP]);
|
|
|
|
|
|
|
|
|
|
bool add_cost = !IsWaterTile(tile);
|
|
|
|
|
CommandCost ret = DoCommand(tile, 0, 0, flags | DC_AUTO, CMD_LANDSCAPE_CLEAR);
|
|
|
|
|
CommandCost ret = DoCommand(tile, 0, 0, flags | DC_AUTO | DC_ALLOW_REMOVE_WATER, CMD_LANDSCAPE_CLEAR);
|
|
|
|
|
if (ret.Failed()) return ret;
|
|
|
|
|
if (add_cost) {
|
|
|
|
|
cost.AddCost(ret);
|
|
|
|
|
}
|
|
|
|
|
add_cost = !IsWaterTile(tile2);
|
|
|
|
|
ret = DoCommand(tile2, 0, 0, flags | DC_AUTO, CMD_LANDSCAPE_CLEAR);
|
|
|
|
|
ret = DoCommand(tile2, 0, 0, flags | DC_AUTO | DC_ALLOW_REMOVE_WATER, CMD_LANDSCAPE_CLEAR);
|
|
|
|
|
if (ret.Failed()) return ret;
|
|
|
|
|
if (add_cost) {
|
|
|
|
|
cost.AddCost(ret);
|
|
|
|
@ -476,7 +476,10 @@ static CommandCost ClearTile_Water(TileIndex tile, DoCommandFlag flags)
|
|
|
|
|
case WATER_TILE_CLEAR: {
|
|
|
|
|
if (flags & DC_NO_WATER) return_cmd_error(STR_ERROR_CAN_T_BUILD_ON_WATER);
|
|
|
|
|
|
|
|
|
|
if (!IsCanal(tile) && _game_mode != GM_EDITOR && !_settings_game.construction.enable_remove_water && !(flags & DC_ALLOW_REMOVE_WATER)) return_cmd_error(STR_ERROR_CAN_T_BUILD_ON_WATER);
|
|
|
|
|
if (!IsCanal(tile) && _game_mode != GM_EDITOR && !_settings_game.construction.enable_remove_water && !(flags & DC_ALLOW_REMOVE_WATER)
|
|
|
|
|
&& _current_company != OWNER_WATER) {
|
|
|
|
|
return_cmd_error(STR_ERROR_CAN_T_BUILD_ON_WATER);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Money base_cost = IsCanal(tile) ? _price[PR_CLEAR_CANAL] : _price[PR_CLEAR_WATER];
|
|
|
|
|
/* Make sure freeform edges are allowed or it's not an edge tile. */
|
|
|
|
|