summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-11-20 14:34:57 +0000
committerrubidium <rubidium@openttd.org>2010-11-20 14:34:57 +0000
commit3ca5951478c7f647c0ccc859b84a082ff7d4f69a (patch)
tree5a5af8eb71590e9971e6e2deee3f9f604c1e2a29
parent3b0ee6557113104416f465fb780d9900fb7a842a (diff)
downloadopenttd-3ca5951478c7f647c0ccc859b84a082ff7d4f69a.tar.xz
(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)
-rw-r--r--src/pathfinder/yapf/yapf_costrail.hpp6
1 files changed, 5 insertions, 1 deletions
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. */