(svn r4750) -Fix: Trains could enter certain sloped rail tiles under bridges with incompatible rail type
authortron
Sat, 06 May 2006 14:32:16 +0000
changeset 3759 129100ab5e8c
parent 3758 572e7321a53a
child 3760 68d223d2df89
(svn r4750) -Fix: Trains could enter certain sloped rail tiles under bridges with incompatible rail type
train_cmd.c
--- a/train_cmd.c	Sat May 06 09:43:38 2006 +0000
+++ b/train_cmd.c	Sat May 06 14:32:16 2006 +0000
@@ -2627,9 +2627,9 @@
 				Slope tileh = GetTileSlope(tile, &height);
 
 				// correct Z position of a train going under a bridge on slopes
-				if (CorrectZ(tileh)) height += TILE_HEIGHT;
-
-				if (v->z_pos != height) return true; // train is going over bridge
+				if (tileh != SLOPE_FLAT) height += TILE_HEIGHT;
+
+				if (v->z_pos > height) return true; // train is going over bridge
 			}
 			break;