diff options
Diffstat (limited to 'src/water_cmd.cpp')
-rw-r--r-- | src/water_cmd.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp index c02a1e9b4..be95c096e 100644 --- a/src/water_cmd.cpp +++ b/src/water_cmd.cpp @@ -10,6 +10,7 @@ #include "stdafx.h" #include "cmd_helper.h" #include "landscape.h" +#include "layer_func.h" #include "viewport_func.h" #include "command_func.h" #include "town.h" @@ -468,6 +469,11 @@ CommandCost CmdBuildCanal(DoCommandFlag flags, TileIndex tile, TileIndex start_t return_cmd_error(STR_ERROR_FLAT_LAND_REQUIRED); } + /* can't make underground water */ + if (IsUnderground(current_tile)) { + return_cmd_error(STR_ERROR_UNDERGROUND_CAN_T_BUILD_UNDER_GROUND); + } + bool water = IsWaterTile(current_tile); /* Outside the editor, prevent building canals over your own or OWNER_NONE owned canals */ @@ -1103,6 +1109,9 @@ void DoFloodTile(TileIndex target) { assert(!IsTileType(target, MP_WATER)); + /* Подземная часть карты не заливается */ + if (IsUnderground(target)) return; + bool flooded = false; // Will be set to true if something is changed. Backup<CompanyID> cur_company(_current_company, OWNER_WATER, FILE_LINE); @@ -1261,7 +1270,7 @@ void ConvertGroundTilesIntoWaterTiles() for (TileIndex tile = 0; tile < MapSize(); ++tile) { Slope slope = GetTileSlope(tile, &z); - if (IsTileType(tile, MP_CLEAR) && z == 0) { + if (IsTileType(tile, MP_CLEAR) && z == 0 && !IsUnderground(tile)) { /* Make both water for tiles at level 0 * and make shore, as that looks much better * during the generation. */ |