summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2008-01-21 15:20:58 +0000
committerfrosch <frosch@openttd.org>2008-01-21 15:20:58 +0000
commit05ab49eb237acf90a85f5f6b50de3851cc10515b (patch)
treee844809e974918ca86bd293f8d208fbeb691fb33
parent6786802863572600f45d4da7ee41d4df0a23f33e (diff)
downloadopenttd-05ab49eb237acf90a85f5f6b50de3851cc10515b.tar.xz
(svn r11936) -Fix: 'BRIDGE_TOO_LOW_FOR_TERRAIN'-check was wrong for steep slopes.
-rw-r--r--src/tunnelbridge_cmd.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp
index 543e600e7..cbeee9d3c 100644
--- a/src/tunnelbridge_cmd.cpp
+++ b/src/tunnelbridge_cmd.cpp
@@ -364,9 +364,7 @@ CommandCost CmdBuildBridge(TileIndex end_tile, uint32 flags, uint32 p1, uint32 p
delta = (direction == AXIS_X ? TileDiffXY(1, 0) : TileDiffXY(0, 1));
for (tile = tile_start + delta; tile != tile_end; tile += delta) {
- uint z;
-
- if (GetTileSlope(tile, &z) != SLOPE_FLAT && z >= z_start) return_cmd_error(STR_BRIDGE_TOO_LOW_FOR_TERRAIN);
+ if (GetTileMaxZ(tile) > z_start) return_cmd_error(STR_BRIDGE_TOO_LOW_FOR_TERRAIN);
if (MayHaveBridgeAbove(tile) && IsBridgeAbove(tile) && !replace_bridge) {
/* Disallow crossing bridges for the time being */