Mercurial > hg > openttd
changeset 17078:5bfb50c7bacd draft
(svn r21815) -Fix [FS#3908]: [YAPF] Apply a pathfinder penalty for back of one-way path signals so those aren't preferred over other possibilities
author | rubidium <rubidium@openttd.org> |
---|---|
date | Sat, 15 Jan 2011 22:40:54 +0000 |
parents | 5a60038ce980 |
children | f0eb11e214d2 |
files | src/pathfinder/yapf/yapf_costrail.hpp |
diffstat | 1 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/pathfinder/yapf/yapf_costrail.hpp +++ b/src/pathfinder/yapf/yapf_costrail.hpp @@ -515,10 +515,13 @@ TILE next(tf_local.m_new_tile, (Trackdir)FindFirstBit2x64(tf_local.m_new_td_bits)); 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)) { + if (HasSignalOnTrackdir(next.tile, next.td) && IsPbsSignal(GetSignalType(next.tile, TrackdirToTrack(next.td)))) { /* Possible safe tile. */ end_segment_reason |= ESRB_SAFE_TILE; + } else if (HasSignalOnTrackdir(next.tile, ReverseTrackdir(next.td)) && GetSignalType(next.tile, TrackdirToTrack(next.td)) == SIGTYPE_PBS_ONEWAY) { + /* Possible safe tile, but not so good as it's the back of a signal... */ + end_segment_reason |= ESRB_SAFE_TILE | ESRB_DEAD_END; + extra_cost += Yapf().PfGetSettings().rail_lastred_exit_penalty; } }