summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2018-08-13 23:44:49 +0200
committerMichael Lutz <michi@icosahedron.de>2018-09-02 21:31:15 +0200
commit4b0b4e06435b76e1cb40a8a65ccdc2307d48081d (patch)
tree47e3af88ac059780ed6604d0684f242c33a181d5 /src/saveload
parent6391d4927744407d6ea8b7336dad34565bc986d0 (diff)
downloadopenttd-4b0b4e06435b76e1cb40a8a65ccdc2307d48081d.tar.xz
Feature: [NewGRF] Increase size of persistent storage to 256.
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/industry_sl.cpp2
-rw-r--r--src/saveload/saveload.cpp3
-rw-r--r--src/saveload/station_sl.cpp2
-rw-r--r--src/saveload/storage_sl.cpp3
4 files changed, 6 insertions, 4 deletions
diff --git a/src/saveload/industry_sl.cpp b/src/saveload/industry_sl.cpp
index b28730e3c..615e8e152 100644
--- a/src/saveload/industry_sl.cpp
+++ b/src/saveload/industry_sl.cpp
@@ -101,7 +101,7 @@ static void Load_INDY()
/* Store the old persistent storage. The GRFID will be added later. */
assert(PersistentStorage::CanAllocateItem());
i->psa = new PersistentStorage(0, 0, 0);
- memcpy(i->psa->storage, _old_ind_persistent_storage.storage, sizeof(i->psa->storage));
+ memcpy(i->psa->storage, _old_ind_persistent_storage.storage, sizeof(_old_ind_persistent_storage.storage));
}
Industry::IncIndustryTypeCount(i->type);
}
diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp
index e06523769..f9c3efd75 100644
--- a/src/saveload/saveload.cpp
+++ b/src/saveload/saveload.cpp
@@ -268,8 +268,9 @@
* 198
* 199
* 200 #6805 Extend railtypes to 64, adding uint16 to map array.
+ * 201 #6885 Extend NewGRF persistant storages.
*/
-extern const uint16 SAVEGAME_VERSION = 200; ///< Current savegame version of OpenTTD.
+extern const uint16 SAVEGAME_VERSION = 201; ///< Current savegame version of OpenTTD.
SavegameType _savegame_type; ///< type of savegame we are loading
FileToSaveLoad _file_to_saveload; ///< File to save or load in the openttd loop.
diff --git a/src/saveload/station_sl.cpp b/src/saveload/station_sl.cpp
index f01123da0..670d6fcf0 100644
--- a/src/saveload/station_sl.cpp
+++ b/src/saveload/station_sl.cpp
@@ -538,7 +538,7 @@ static void Load_STNN()
/* Store the old persistent storage. The GRFID will be added later. */
assert(PersistentStorage::CanAllocateItem());
st->airport.psa = new PersistentStorage(0, 0, 0);
- memcpy(st->airport.psa->storage, _old_st_persistent_storage.storage, sizeof(st->airport.psa->storage));
+ memcpy(st->airport.psa->storage, _old_st_persistent_storage.storage, sizeof(_old_st_persistent_storage.storage));
}
for (CargoID i = 0; i < num_cargo; i++) {
diff --git a/src/saveload/storage_sl.cpp b/src/saveload/storage_sl.cpp
index 110df63a7..04980c7c3 100644
--- a/src/saveload/storage_sl.cpp
+++ b/src/saveload/storage_sl.cpp
@@ -18,7 +18,8 @@
/** Description of the data to save and load in #PersistentStorage. */
static const SaveLoad _storage_desc[] = {
SLE_CONDVAR(PersistentStorage, grfid, SLE_UINT32, 6, SL_MAX_VERSION),
- SLE_CONDARR(PersistentStorage, storage, SLE_UINT32, 16, 161, SL_MAX_VERSION),
+ SLE_CONDARR(PersistentStorage, storage, SLE_UINT32, 16, 161, 200),
+ SLE_CONDARR(PersistentStorage, storage, SLE_UINT32, 256, 201, SL_MAX_VERSION),
SLE_END()
};