summaryrefslogtreecommitdiff
path: root/src/tunnelbridge_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-06-24 16:44:06 +0000
committerrubidium <rubidium@openttd.org>2007-06-24 16:44:06 +0000
commitb17b9351dd4e27fe15642655cd58bd6a3731d788 (patch)
tree25c98a8865d24fd5d5f8a35cd24d5b85df3074a1 /src/tunnelbridge_cmd.cpp
parentaf5667394c8d3ca37b5b02776679d4766547419e (diff)
downloadopenttd-b17b9351dd4e27fe15642655cd58bd6a3731d788.tar.xz
(svn r10306) -Fix [FS#890]: the fix in r10219 was not enough to stop this bug from happening.
Diffstat (limited to 'src/tunnelbridge_cmd.cpp')
-rw-r--r--src/tunnelbridge_cmd.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp
index bd944b813..1a3bc0243 100644
--- a/src/tunnelbridge_cmd.cpp
+++ b/src/tunnelbridge_cmd.cpp
@@ -522,6 +522,15 @@ CommandCost CmdBuildTunnel(TileIndex start_tile, uint32 flags, uint32 p1, uint32
/* slope of end tile must be complementary to the slope of the start tile */
if (end_tileh != ComplementSlope(start_tileh)) {
+ /* Some (rail) track bits might be terraformed into the correct direction,
+ * but that would still leave tracks on foundation. Therefor excavation will
+ * always fail for rail tiles. On the other hand, for road tiles it might
+ * succeed when there is only one road bit on the tile, but then that road
+ * bit is removed leaving a clear tile.
+ * This therefor preserves the behaviour that half road tiles are always removable.
+ */
+ if (IsTileType(end_tile, MP_RAILWAY)) return_cmd_error(STR_1008_MUST_REMOVE_RAILROAD_TRACK);
+
ret = DoCommand(end_tile, end_tileh & start_tileh, 0, flags, CMD_TERRAFORM_LAND);
if (CmdFailed(ret)) return_cmd_error(STR_5005_UNABLE_TO_EXCAVATE_LAND);
} else {