(svn r21271) -Change: use the last red instead of last red exit penalty for making sure other waypoint entries are evaluated as well when they are occupied, e.g. when there are no signals before the waypoint but a train just beyond the waypoint is stopped (like for stations)

This commit is contained in:
rubidium 2010-11-20 14:34:57 +00:00
parent 3b0ee65571
commit 3ca5951478
1 changed files with 5 additions and 1 deletions

View File

@ -435,10 +435,14 @@ no_entry_cost: // jump here at the beginning if the node has no parent (it is th
/* If this is a safe waiting position we're done searching for it */
if (IsSafeWaitingPosition(v, t, td, true, _settings_game.pf.forbid_90_deg)) break;
}
/* In the case this platform is (possibly) occupied we add penalty so the
* other platforms of this waypoint are evaluated as well, i.e. we assume
* that there is a red signal in the waypoint when it's occupied. */
if (td == INVALID_TRACKDIR ||
!IsSafeWaitingPosition(v, t, td, true, _settings_game.pf.forbid_90_deg) ||
!IsWaitingPositionFree(v, t, td, _settings_game.pf.forbid_90_deg)) {
extra_cost += Yapf().PfGetSettings().rail_lastred_exit_penalty;
extra_cost += Yapf().PfGetSettings().rail_lastred_penalty;
}
}
/* Waypoint is also a good reason to finish. */