From cd9821fb3978b6759ff567819d981d927d4670be Mon Sep 17 00:00:00 2001 From: tron Date: Sat, 6 May 2006 14:32:16 +0000 Subject: [PATCH] (svn r4750) -Fix: Trains could enter certain sloped rail tiles under bridges with incompatible rail type --- train_cmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/train_cmd.c b/train_cmd.c index bb0bd813f9..a4ae5d61e0 100644 --- a/train_cmd.c +++ b/train_cmd.c @@ -2627,9 +2627,9 @@ static bool CheckCompatibleRail(const Vehicle *v, TileIndex tile) Slope tileh = GetTileSlope(tile, &height); // correct Z position of a train going under a bridge on slopes - if (CorrectZ(tileh)) height += TILE_HEIGHT; + if (tileh != SLOPE_FLAT) height += TILE_HEIGHT; - if (v->z_pos != height) return true; // train is going over bridge + if (v->z_pos > height) return true; // train is going over bridge } break;