summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-05-23 20:02:52 +0000
committerpeter1138 <peter1138@openttd.org>2006-05-23 20:02:52 +0000
commitef8eaf3f3916420d727efd2c449caad3f3c00f12 (patch)
treecdfcbdf2d30a16f1ec0e2aedf45ce2af85e12d5a
parentae8f4f8d9abcda1f97ddc24287e17fb3d0625cb1 (diff)
downloadopenttd-ef8eaf3f3916420d727efd2c449caad3f3c00f12.tar.xz
(svn r4964) - Fix NTP over bridges: don't check the rail type when on a bridge
-rw-r--r--pathfind.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/pathfind.c b/pathfind.c
index fd27379ad..eff90d60a 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;
+ }
}
///////////////////