summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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. */