summaryrefslogtreecommitdiff
path: root/tunnelbridge_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-05-07 08:18:12 +0000
committertron <tron@openttd.org>2006-05-07 08:18:12 +0000
commit00930cf8d9f3470e78d0316aeaa12b613687be37 (patch)
tree250d67c9da85749c885b8db70d2108081354dece /tunnelbridge_cmd.c
parentebcf2ee3b143286f184144da1970327c33fc3e1c (diff)
downloadopenttd-00930cf8d9f3470e78d0316aeaa12b613687be37.tar.xz
(svn r4766) -Fix: Vehicles on a sloped tile under a bridge were affected by the bridge speed limit
Diffstat (limited to 'tunnelbridge_cmd.c')
-rw-r--r--tunnelbridge_cmd.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/tunnelbridge_cmd.c b/tunnelbridge_cmd.c
index aca77e9e1..9d80be942 100644
--- a/tunnelbridge_cmd.c
+++ b/tunnelbridge_cmd.c
@@ -1357,10 +1357,7 @@ static uint32 VehicleEnter_TunnelBridge(Vehicle *v, TileIndex tile, int x, int y
}
} else if (IsBridge(tile)) { // XXX is this necessary?
if (v->type == VEH_Road || (v->type == VEH_Train && IsFrontEngine(v))) {
- uint h = GetTileMaxZ(tile);
-
- if (IsBridgeRamp(tile) ||
- myabs(h - v->z_pos) > 2) { // high above the ground -> on the bridge
+ if (IsBridgeRamp(tile) || v->z_pos > GetTileMaxZ(tile)) {
/* modify speed of vehicle */
uint16 spd = _bridge[GetBridgeType(tile)].speed;
if (v->type == VEH_Road) spd *= 2;