summaryrefslogtreecommitdiff
path: root/src/water_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/water_cmd.cpp')
-rw-r--r--src/water_cmd.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp
index 6b4f41eb9..ad047cfd6 100644
--- a/src/water_cmd.cpp
+++ b/src/water_cmd.cpp
@@ -12,6 +12,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"
@@ -419,6 +420,11 @@ CommandCost CmdBuildCanal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
/* can't make water of water! */
if (IsTileType(tile, MP_WATER) && (!IsTileOwner(tile, OWNER_WATER) || wc == WATER_CLASS_SEA)) continue;
+ /* can't make underground water */
+ if (IsUnderground(tile)) {
+ return_cmd_error(STR_ERROR_UNDERGROUND_CAN_T_BUILD_UNDER_GROUND);
+ }
+
bool water = IsWaterTile(tile);
ret = DoCommand(tile, 0, 0, flags | DC_FORCE_CLEAR_TILE, CMD_LANDSCAPE_CLEAR);
if (ret.Failed()) return ret;
@@ -1043,6 +1049,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<CompanyByte> cur_company(_current_company, OWNER_WATER, FILE_LINE);
@@ -1197,7 +1206,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. */