train_cmd.c
changeset 1192 2649bd4e556a
parent 1179 ce0a75460808
child 1196 67f7f3017d99
--- a/train_cmd.c	Thu Jan 27 11:33:14 2005 +0000
+++ b/train_cmd.c	Thu Jan 27 12:52:20 2005 +0000
@@ -2049,13 +2049,13 @@
 
 		case MP_TUNNELBRIDGE:
 			if ((_map5[tile] & 0xC0) == 0xC0) { // is bridge middle part?
-				TileInfo ti;
-				FindLandscapeHeightByTile(&ti, tile);
+				uint height;
+				uint tileh = GetTileSlope(tile, &height);
 
 				// correct Z position of a train going under a bridge on slopes
-				if (CORRECT_Z(ti.tileh)) ti.z += 8;
-
-				if (v->z_pos != ti.z) return true; // train is going over bridge
+				if (CORRECT_Z(tileh)) height += 8;
+
+				if (v->z_pos != height) return true; // train is going over bridge
 			}
 			break;