YAPF: Add penalty when reversing at waypoint which is already reserved

This commit is contained in:
Jonathan G Rennison
2021-03-27 18:32:14 +00:00
parent 923b2eb0a9
commit 63fda2f16e

View File

@@ -599,6 +599,10 @@ no_entry_cost: // jump here at the beginning if the node has no parent (it is th
!IsWaitingPositionFree(v, t, td, _settings_game.pf.forbid_90_deg)) {
extra_cost += Yapf().PfGetSettings().rail_lastred_penalty;
}
if (v->current_order.GetWaypointFlags() & OWF_REVERSE && HasStationReservation(cur.tile)) {
extra_cost += Yapf().PfGetSettings().rail_pbs_station_penalty * 4;
}
}
/* Waypoint is also a good reason to finish. */
end_segment_reason |= ESRB_WAYPOINT;