summaryrefslogtreecommitdiff
path: root/src/saveload/afterload.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/saveload/afterload.cpp')
-rw-r--r--src/saveload/afterload.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp
index 1529aca2b..077f86bf6 100644
--- a/src/saveload/afterload.cpp
+++ b/src/saveload/afterload.cpp
@@ -3033,6 +3033,15 @@ bool AfterLoadGame()
i->accepts_cargo[ci] = CT_INVALID;
i->incoming_cargo_waiting[ci] = 0;
}
+ /* Make sure last_cargo_accepted_at is copied to elements for every valid input cargo.
+ * The loading routine should put the original singular value into the first array element. */
+ for (size_t ci = 0; ci < lengthof(i->accepts_cargo); ci++) {
+ if (i->accepts_cargo[ci] != CT_INVALID) {
+ i->last_cargo_accepted_at[ci] = i->last_cargo_accepted_at[0];
+ } else {
+ i->last_cargo_accepted_at[ci] = 0;
+ }
+ }
}
}