From 72e2e21cb5f05b0f66f5f1d5a524eb597f5ba3fc Mon Sep 17 00:00:00 2001 From: yexo Date: Sun, 5 Sep 2010 14:54:18 +0000 Subject: (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 --- src/object_cmd.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/object_cmd.cpp') 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); -- cgit v1.2.3-54-g00ecf