From 40ba9933dc21d878cf25dd45597a5e7c0de79562 Mon Sep 17 00:00:00 2001 From: michi_cc Date: Sun, 27 Dec 2009 14:37:54 +0000 Subject: (svn r18648) -Fix/Feature [FS#3430-ish]: [YAPP] Treat the backside of an one-way path signals as a safe waiting point. --- src/pbs.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3-70-g09d2