summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2004-11-03 11:35:29 +0000
committertron <tron@openttd.org>2004-11-03 11:35:29 +0000
commitf7485d586e57de49fd0a1270fe9e9cefb8300fde (patch)
tree443e1b0f0a7c7aa299ac4ba231de223987e1c04f
parentfe1ccdf834ba585aeb8cbef3f4119bb8d0afd67a (diff)
downloadopenttd-f7485d586e57de49fd0a1270fe9e9cefb8300fde.tar.xz
(svn r501) -Fix: Vehicles slow down under bridge if the track is on a foundation
-rw-r--r--tunnelbridge_cmd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tunnelbridge_cmd.c b/tunnelbridge_cmd.c
index c8009d662..7066003f9 100644
--- a/tunnelbridge_cmd.c
+++ b/tunnelbridge_cmd.c
@@ -1455,7 +1455,10 @@ static uint32 VehicleEnter_TunnelBridge(Vehicle *v, uint tile, int x, int y)
}
} else if (_map5[tile] & 0x80) {
if (v->type == VEH_Road || (v->type == VEH_Train && v->subtype == 0)) {
- if (GetTileSlope(tile, &h) != 0 || myabs(h - v->z_pos) > 2) {
+ if (GetTileSlope(tile, &h) != 0)
+ h += 8; // Compensate for possible foundation
+ if (!(_map5[tile] & 0x40) || // start/end tile of bridge
+ myabs(h - v->z_pos) > 2) { // high above the ground -> on the bridge
/* modify speed of vehicle */
uint16 spd = _bridge_speeds[_map2[tile] >> 4];
if (v->type == VEH_Road) spd<<=1;