mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +00:00
Fix last station visited not being set when reservation ends at target
Long reserve and subsequent routing restrictions immediately beyond the reservation were evaluated without the last station visited being updated to reflect that the target station was already reached.
This commit is contained in:
parent
afd66c1631
commit
3c55250cd6
@ -4304,6 +4304,9 @@ static Track ChooseTrainTrack(Train *v, TileIndex tile, DiagDirection enterdir,
|
|||||||
|
|
||||||
if (got_reservation) {
|
if (got_reservation) {
|
||||||
if (v->current_order.IsBaseStationOrder() && HasStationTileRail(res_dest.tile) && v->current_order.GetDestination() == GetStationIndex(res_dest.tile)) {
|
if (v->current_order.IsBaseStationOrder() && HasStationTileRail(res_dest.tile) && v->current_order.GetDestination() == GetStationIndex(res_dest.tile)) {
|
||||||
|
if (v->current_order.ShouldStopAtStation(v, v->current_order.GetDestination(), v->current_order.IsType(OT_GOTO_WAYPOINT))) {
|
||||||
|
v->last_station_visited = v->current_order.GetDestination();
|
||||||
|
}
|
||||||
orders.SwitchToNextOrder(true);
|
orders.SwitchToNextOrder(true);
|
||||||
}
|
}
|
||||||
if (_settings_game.vehicle.train_braking_model == TBM_REALISTIC) {
|
if (_settings_game.vehicle.train_braking_model == TBM_REALISTIC) {
|
||||||
|
Loading…
Reference in New Issue
Block a user