summaryrefslogtreecommitdiff
path: root/src/saveload/afterload.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-01-09 14:43:08 +0000
committerrubidium <rubidium@openttd.org>2010-01-09 14:43:08 +0000
commite4af35d316158767ddd19d87ac1c92086be7a71c (patch)
tree209595e66247eac0defe0806ff0f08706fc7adee /src/saveload/afterload.cpp
parentf65f276d10e528ffe2581656cfa8066a20002995 (diff)
downloadopenttd-e4af35d316158767ddd19d87ac1c92086be7a71c.tar.xz
(svn r18764) -Fix [FS#3422]: split the (un)load ticks counter and signal wait counter; sometimes they might get into eachother's way
Diffstat (limited to 'src/saveload/afterload.cpp')
-rw-r--r--src/saveload/afterload.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp
index d5eb046bc..a7399431d 100644
--- a/src/saveload/afterload.cpp
+++ b/src/saveload/afterload.cpp
@@ -1997,6 +1997,19 @@ bool AfterLoadGame()
}
}
+ /* Wait counter and load/unload ticks got split. */
+ if (CheckSavegameVersion(136)) {
+ Aircraft *a;
+ FOR_ALL_AIRCRAFT(a) {
+ a->turn_counter = a->current_order.IsType(OT_LOADING) ? 0 : a->load_unload_ticks;
+ }
+
+ Train *t;
+ FOR_ALL_TRAINS(t) {
+ t->wait_counter = t->current_order.IsType(OT_LOADING) ? 0 : t->load_unload_ticks;
+ }
+ }
+
/* Road stops is 'only' updating some caches */
AfterLoadRoadStops();
AfterLoadLabelMaps();