Add support for multiple scheduled dispatch schedules per order list

This commit is contained in:
Jonathan G Rennison
2022-01-13 19:46:43 +00:00
parent 29521ef883
commit ff3473fe6a
23 changed files with 755 additions and 367 deletions

View File

@@ -3999,6 +3999,22 @@ bool AfterLoadGame()
_settings_game.vehicle.through_load_speed_limit = 15;
}
if (SlXvIsFeaturePresent(XSLFI_SCHEDULED_DISPATCH, 1, 2)) {
for (OrderList *order_list : OrderList::Iterate()) {
if (order_list->GetScheduledDispatchScheduleCount() == 1) {
const DispatchSchedule &ds = order_list->GetDispatchScheduleByIndex(0);
if (!ds.IsScheduledDispatchValid() && ds.GetScheduledDispatch().empty()) {
order_list->GetScheduledDispatchScheduleSet().clear();
} else {
VehicleOrderID idx = order_list->GetFirstSharedVehicle()->GetFirstWaitingLocation(false);
if (idx != INVALID_VEH_ORDER_ID) {
order_list->GetOrderAt(idx)->SetDispatchScheduleIndex(0);
}
}
}
}
}
InitializeRoadGUI();
/* This needs to be done after conversion. */