Scheduled dispatch: Allow wrapping at midnight when bulk inserting slots

For 24 hour dispatch schedules

See: #467
This commit is contained in:
Jonathan G Rennison
2022-12-27 00:13:37 +00:00
parent 87056562e5
commit 541beb386c
2 changed files with 13 additions and 3 deletions

View File

@@ -98,6 +98,7 @@ CommandCost CmdScheduledDispatchAdd(TileIndex tile, DoCommandFlag flags, uint32
ds.AddScheduledDispatch(p2);
for (uint i = 0; i < extra_slots; i++) {
p2 += offset;
if (p2 >= ds.GetScheduledDispatchDuration()) p2 -= ds.GetScheduledDispatchDuration();
ds.AddScheduledDispatch(p2);
}
SetTimetableWindowsDirty(v, true);