From 3ca5951478c7f647c0ccc859b84a082ff7d4f69a Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 20 Nov 2010 14:34:57 +0000 Subject: (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) --- src/pathfinder/yapf/yapf_costrail.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/pathfinder/yapf/yapf_costrail.hpp b/src/pathfinder/yapf/yapf_costrail.hpp index 1de6eba78..53f7f60af 100644 --- a/src/pathfinder/yapf/yapf_costrail.hpp +++ b/src/pathfinder/yapf/yapf_costrail.hpp @@ -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. */ -- cgit v1.2.3-54-g00ecf