summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-09-05 14:54:18 +0000
committeryexo <yexo@openttd.org>2010-09-05 14:54:18 +0000
commit72e2e21cb5f05b0f66f5f1d5a524eb597f5ba3fc (patch)
treef1eb22c101b0343c90f625851b307cc026b96ca6
parent0ab95ba636ea2fb00f8dfbcc35a9916fcc872497 (diff)
downloadopenttd-72e2e21cb5f05b0f66f5f1d5a524eb597f5ba3fc.tar.xz
(svn r20745) -Fix: don't delete an object when trying to terraform a tile of it with canal under it. If we delete the object the terraforming will still fail due to the canal
-rw-r--r--src/object_cmd.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp
index cedec4188..ed68643e7 100644
--- a/src/object_cmd.cpp
+++ b/src/object_cmd.cpp
@@ -640,6 +640,8 @@ static CommandCost TerraformTile_Object(TileIndex tile, DoCommandFlag flags, uin
{
ObjectType type = GetObjectType(tile);
+ if (GetWaterClass(tile) == WATER_CLASS_CANAL) return_cmd_error(STR_ERROR_MUST_DEMOLISH_CANAL_FIRST);
+
if (type == OBJECT_OWNED_LAND) {
/* Owned land remains unsold */
CommandCost ret = CheckTileOwnership(tile);