(svn r11936) -Fix: 'BRIDGE_TOO_LOW_FOR_TERRAIN'-check was wrong for steep slopes.
authorfrosch
Mon, 21 Jan 2008 15:20:58 +0000
changeset 8866 1e2ffbfaaf1c
parent 8865 1884a11b74de
child 8867 4d1c696c62b9
(svn r11936) -Fix: 'BRIDGE_TOO_LOW_FOR_TERRAIN'-check was wrong for steep slopes.
src/tunnelbridge_cmd.cpp
--- a/src/tunnelbridge_cmd.cpp	Mon Jan 21 10:31:27 2008 +0000
+++ b/src/tunnelbridge_cmd.cpp	Mon Jan 21 15:20:58 2008 +0000
@@ -364,9 +364,7 @@
 
 	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 */