Check that order is station type when comparing with last_station_visited
This commit is contained in:
@@ -677,7 +677,8 @@ CargoMaskedStationIDStack OrderList::GetNextStoppingStation(const Vehicle *v, Ca
|
|||||||
});
|
});
|
||||||
if (invalid) return CargoMaskedStationIDStack(cargo_mask, INVALID_STATION);
|
if (invalid) return CargoMaskedStationIDStack(cargo_mask, INVALID_STATION);
|
||||||
}
|
}
|
||||||
} while (next->IsType(OT_GOTO_DEPOT) || next->IsType(OT_RELEASE_SLOT) || next->IsType(OT_COUNTER) || next->IsType(OT_DUMMY) || next->GetDestination() == v->last_station_visited);
|
} while (next->IsType(OT_GOTO_DEPOT) || next->IsType(OT_RELEASE_SLOT) || next->IsType(OT_COUNTER) || next->IsType(OT_DUMMY)
|
||||||
|
|| (next->IsBaseStationOrder() && next->GetDestination() == v->last_station_visited));
|
||||||
|
|
||||||
return CargoMaskedStationIDStack(cargo_mask, next->GetDestination());
|
return CargoMaskedStationIDStack(cargo_mask, next->GetDestination());
|
||||||
}
|
}
|
||||||
|
@@ -53,7 +53,7 @@ static void ChangeTimetable(Vehicle *v, VehicleOrderID order_number, uint32 val,
|
|||||||
order->SetWaitTimetabled(timetabled);
|
order->SetWaitTimetabled(timetabled);
|
||||||
if (HasBit(v->vehicle_flags, VF_SCHEDULED_DISPATCH) && timetabled && order->IsScheduledDispatchOrder(true)) {
|
if (HasBit(v->vehicle_flags, VF_SCHEDULED_DISPATCH) && timetabled && order->IsScheduledDispatchOrder(true)) {
|
||||||
for (Vehicle *u = v->FirstShared(); u != nullptr; u = u->NextShared()) {
|
for (Vehicle *u = v->FirstShared(); u != nullptr; u = u->NextShared()) {
|
||||||
if (u->cur_implicit_order_index == order_number && (u->last_station_visited == order->GetDestination())) {
|
if (u->cur_implicit_order_index == order_number && order->IsBaseStationOrder() && u->last_station_visited == order->GetDestination()) {
|
||||||
u->lateness_counter += timetable_delta;
|
u->lateness_counter += timetable_delta;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user