summaryrefslogtreecommitdiff
path: root/src/clear_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/clear_cmd.cpp')
-rw-r--r--src/clear_cmd.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/clear_cmd.cpp b/src/clear_cmd.cpp
index c69ff0d99..7b95d085a 100644
--- a/src/clear_cmd.cpp
+++ b/src/clear_cmd.cpp
@@ -22,6 +22,7 @@
#include "unmovable_map.h"
#include "genworld.h"
#include "industry.h"
+#include "water_map.h"
struct TerraformerHeightMod {
TileIndex tile;
@@ -141,6 +142,13 @@ static int TerraformProc(TerraformerState *ts, TileIndex tile, int mode)
}
}
+ /* Canals can't be terraformed */
+ if (IsClearWaterTile(tile) && IsCanal(tile)) {
+ _terraform_err_tile = tile;
+ _error_message = STR_MUST_DEMOLISH_CANAL_FIRST;
+ return -1;
+ }
+
ret = DoCommand(tile, 0, 0, ts->flags & ~DC_EXEC, CMD_LANDSCAPE_CLEAR);
if (CmdFailed(ret)) {