summaryrefslogtreecommitdiff
path: root/src/pathfinder
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2010-05-26 05:24:58 +0000
committermichi_cc <michi_cc@openttd.org>2010-05-26 05:24:58 +0000
commitf3b56340c23ffc1d64d5c0830fa1f896e0965332 (patch)
tree238935f51f87db7fb53301aed85a9ba0b83e9c37 /src/pathfinder
parent3e7fc229ab83090dc48c8df244582ae4ad3e0d01 (diff)
downloadopenttd-f3b56340c23ffc1d64d5c0830fa1f896e0965332.tar.xz
(svn r19896) -Fix [FS#3803] (r18648): [YAPP] Inform the pathfinder as well about the fact that the backside of an one-way path signal can be a safe waiting point.
Diffstat (limited to 'src/pathfinder')
-rw-r--r--src/pathfinder/yapf/yapf_costrail.hpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/pathfinder/yapf/yapf_costrail.hpp b/src/pathfinder/yapf/yapf_costrail.hpp
index 3badace9a..e38ae52c8 100644
--- a/src/pathfinder/yapf/yapf_costrail.hpp
+++ b/src/pathfinder/yapf/yapf_costrail.hpp
@@ -507,9 +507,12 @@ no_entry_cost: // jump here at the beginning if the node has no parent (it is th
/* Gather the next tile/trackdir/tile_type/rail_type. */
TILE next(tf_local.m_new_tile, (Trackdir)FindFirstBit2x64(tf_local.m_new_td_bits));
- if (TrackFollower::DoTrackMasking() && HasPbsSignalOnTrackdir(next.tile, next.td)) {
- /* Possible safe tile. */
- end_segment_reason |= ESRB_SAFE_TILE;
+ if (TrackFollower::DoTrackMasking() && IsTileType(next.tile, MP_RAILWAY)) {
+ if ((HasSignalOnTrackdir(next.tile, next.td) && IsPbsSignal(GetSignalType(next.tile, TrackdirToTrack(next.td)))) ||
+ (HasSignalOnTrackdir(next.tile, ReverseTrackdir(next.td)) && GetSignalType(next.tile, TrackdirToTrack(next.td)) == SIGTYPE_PBS_ONEWAY)) {
+ /* Possible safe tile. */
+ end_segment_reason |= ESRB_SAFE_TILE;
+ }
}
/* Check the next tile for the rail type. */