summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/afterload.cpp9
-rw-r--r--src/saveload/industry_sl.cpp3
2 files changed, 11 insertions, 1 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;
+ }
+ }
}
}
diff --git a/src/saveload/industry_sl.cpp b/src/saveload/industry_sl.cpp
index 9727e4e51..a9c84e62a 100644
--- a/src/saveload/industry_sl.cpp
+++ b/src/saveload/industry_sl.cpp
@@ -61,7 +61,8 @@ static const SaveLoad _industry_desc[] = {
SLE_CONDVAR(Industry, founder, SLE_UINT8, 70, SL_MAX_VERSION),
SLE_CONDVAR(Industry, construction_date, SLE_INT32, 70, SL_MAX_VERSION),
SLE_CONDVAR(Industry, construction_type, SLE_UINT8, 70, SL_MAX_VERSION),
- SLE_CONDVAR(Industry, last_cargo_accepted_at, SLE_INT32, 70, SL_MAX_VERSION),
+ SLE_CONDVAR(Industry, last_cargo_accepted_at[0], SLE_INT32, 70, 201),
+ SLE_CONDARR(Industry, last_cargo_accepted_at, SLE_INT32, 16, 202, SL_MAX_VERSION),
SLE_CONDVAR(Industry, selected_layout, SLE_UINT8, 73, SL_MAX_VERSION),
SLEG_CONDARR(_old_ind_persistent_storage.storage, SLE_UINT32, 16, 76, 160),