diff options
author | michi_cc <michi_cc@openttd.org> | 2009-12-27 14:37:54 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2009-12-27 14:37:54 +0000 |
commit | 40ba9933dc21d878cf25dd45597a5e7c0de79562 (patch) | |
tree | f66bf3a61760d89ab4a7ccfa120c4a23550a37f5 | |
parent | f7025612e1bfb10619a216a92960b701ede1b643 (diff) | |
download | openttd-40ba9933dc21d878cf25dd45597a5e7c0de79562.tar.xz |
(svn r18648) -Fix/Feature [FS#3430-ish]: [YAPP] Treat the backside of an one-way path signals as a safe waiting point.
-rw-r--r-- | src/pbs.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/pbs.cpp b/src/pbs.cpp index 9619b201b..3c25dfa03 100644 --- a/src/pbs.cpp +++ b/src/pbs.cpp @@ -369,8 +369,14 @@ bool IsSafeWaitingPosition(const Train *v, TileIndex tile, Trackdir trackdir, bo if (ft.m_new_td_bits == TRACKDIR_BIT_NONE) return include_line_end; if (ft.m_new_td_bits != TRACKDIR_BIT_NONE && KillFirstBit(ft.m_new_td_bits) == TRACKDIR_BIT_NONE) { + Trackdir td = FindFirstTrackdir(ft.m_new_td_bits); /* PBS signal on next trackdir? Safe position. */ - if (HasPbsSignalOnTrackdir(ft.m_new_tile, FindFirstTrackdir(ft.m_new_td_bits))) return true; + if (HasPbsSignalOnTrackdir(ft.m_new_tile, td)) return true; + /* One-way PBS signal against us? Safe if end-of-line is allowed. */ + if (IsTileType(ft.m_new_tile, MP_RAILWAY) && HasSignalOnTrackdir(ft.m_new_tile, ReverseTrackdir(td)) && + GetSignalType(ft.m_new_tile, TrackdirToTrack(td)) == SIGTYPE_PBS_ONEWAY) { + return include_line_end; + } } return false; |