Scheduled dispatch: Fixup start dates when changing game date

This commit is contained in:
Jonathan G Rennison
2020-06-20 21:27:19 +01:00
parent d160536315
commit ca79a32890
5 changed files with 15 additions and 0 deletions

View File

@@ -3004,3 +3004,12 @@ CommandCost CmdMassChangeOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, u
}
return CommandCost();
}
void ShiftOrderDates(int interval)
{
for (OrderList *orderlist : OrderList::Iterate()) {
if (orderlist->GetScheduledDispatchStartDatePart() >= 0) {
orderlist->SetScheduledDispatchStartDate(orderlist->GetScheduledDispatchStartDatePart() + interval, orderlist->GetScheduledDispatchStartDateFractPart());
}
}
}