diff options
author | Charles Pigott <charlespigott@googlemail.com> | 2020-01-03 14:11:33 +0000 |
---|---|---|
committer | Charles Pigott <charlespigott@googlemail.com> | 2020-01-05 20:51:26 +0000 |
commit | d1cead7f251e09e572c73130bad601f7d991ecc6 (patch) | |
tree | cf8b1c6b508eccbe0760f1b6b397c6b187f9c801 /src/saveload/afterload.cpp | |
parent | cddb8a4605570666e076ab0e0f7b1f986f393e17 (diff) | |
download | openttd-d1cead7f251e09e572c73130bad601f7d991ecc6.tar.xz |
Fix: When loading old timetabled saves, also reset cached timetable duration
Diffstat (limited to 'src/saveload/afterload.cpp')
-rw-r--r-- | src/saveload/afterload.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 47d2c7b03..c37c297c5 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -2963,6 +2963,16 @@ bool AfterLoadGame() } } + if (IsSavegameVersionBefore(SLV_190)) { + for (Order *order : Order::Iterate()) { + order->SetTravelTimetabled(order->GetTravelTime() > 0); + order->SetWaitTimetabled(order->GetWaitTime() > 0); + } + for (OrderList *orderlist : OrderList::Iterate()) { + orderlist->RecalculateTimetableDuration(); + } + } + /* * Only keep order-backups for network clients (and when replaying). * If we are a network server or not networking, then we just loaded a previously |