summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-06-14 09:52:50 +0000
committertron <tron@openttd.org>2006-06-14 09:52:50 +0000
commit17c15fab3efc4dfc7514bf89bbd9971abb178ea4 (patch)
tree016d13353a5def1e3c5f3db47f47bdc4bf14e347
parentf5638395fe8b48028fcc58337d58b6d1e9798fc4 (diff)
downloadopenttd-17c15fab3efc4dfc7514bf89bbd9971abb178ea4.tar.xz
(svn r5260) -Fix: It was possible to convert the railtype of a bridge while a train was on it
-rw-r--r--tunnelbridge_cmd.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/tunnelbridge_cmd.c b/tunnelbridge_cmd.c
index 2437915e0..067db215b 100644
--- a/tunnelbridge_cmd.c
+++ b/tunnelbridge_cmd.c
@@ -788,7 +788,6 @@ int32 DoConvertTunnelBridgeRail(TileIndex tile, RailType totype, bool exec)
}
return _price.build_rail >> 1;
} else if (IsBridge(tile) && IsBridgeRamp(tile) && GetBridgeTransportType(tile) == TRANSPORT_RAIL) {
- uint z = TilePixelHeight(tile) + TILE_HEIGHT;
const Vehicle* v;
TileIndexDiff delta;
int32 cost;
@@ -797,7 +796,7 @@ int32 DoConvertTunnelBridgeRail(TileIndex tile, RailType totype, bool exec)
endtile = GetOtherBridgeEnd(tile);
// Make sure there's no vehicle on the bridge
- v = FindVehicleBetween(tile, endtile, z);
+ v = FindVehicleBetween(tile, endtile, GetBridgeHeightRamp(tile));
if (v != NULL) {
return_cmd_error(VehicleInTheWayErrMsg(v));
}