(svn r4964) - Fix NTP over bridges: don't check the rail type when on a bridge
authorpeter1138
Tue, 23 May 2006 20:02:52 +0000
changeset 3894 a1b964f73bb9
parent 3893 46169364701b
child 3895 a67d4451a1df
(svn r4964) - Fix NTP over bridges: don't check the rail type when on a bridge
pathfind.c
--- a/pathfind.c	Tue May 23 19:36:50 2006 +0000
+++ b/pathfind.c	Tue May 23 20:02:52 2006 +0000
@@ -734,9 +734,13 @@
 				// Check that the tile contains exactly one track
 				if (bits == 0 || KILL_FIRST_BIT(bits) != 0) break;
 
-				if (IsTileType(tile, MP_STREET) ? !HASBIT(tpf->railtypes, GetRailTypeCrossing(tile)) : !HASBIT(tpf->railtypes, GetRailType(tile))) {
-					bits = 0;
-					break;
+				/* Check the rail type only if the train is *NOT* on top of
+				 * a bridge. */
+				if (!(IsBridgeTile(tile) && IsBridgeMiddle(tile) && GetBridgeAxis(tile) == DiagDirToAxis(direction))) {
+					if (IsTileType(tile, MP_STREET) ? !HASBIT(tpf->railtypes, GetRailTypeCrossing(tile)) : !HASBIT(tpf->railtypes, GetRailType(tile))) {
+						bits = 0;
+						break;
+					}
 				}
 
 				///////////////////