summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2009-12-27 14:37:54 +0000
committermichi_cc <michi_cc@openttd.org>2009-12-27 14:37:54 +0000
commit40ba9933dc21d878cf25dd45597a5e7c0de79562 (patch)
treef66bf3a61760d89ab4a7ccfa120c4a23550a37f5
parentf7025612e1bfb10619a216a92960b701ede1b643 (diff)
downloadopenttd-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.cpp8
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;