From ef8eaf3f3916420d727efd2c449caad3f3c00f12 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Tue, 23 May 2006 20:02:52 +0000 Subject: [PATCH] (svn r4964) - Fix NTP over bridges: don't check the rail type when on a bridge --- pathfind.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pathfind.c b/pathfind.c index fd27379ad5..eff90d60a1 100644 --- a/pathfind.c +++ b/pathfind.c @@ -734,9 +734,13 @@ start_at: // 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; + } } ///////////////////