Merge branch 'master' into jgrpp

# Conflicts:
#	src/saveload/saveload.cpp
This commit is contained in:
Jonathan G Rennison
2018-09-20 08:32:56 +01:00
15 changed files with 75 additions and 22 deletions

View File

@@ -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);
}

View File

@@ -277,8 +277,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.
const uint16 SAVEGAME_VERSION_EXT = 0x8000; ///< Savegame extension indicator mask
SavegameType _savegame_type; ///< type of savegame we are loading

View File

@@ -575,7 +575,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++) {

View File

@@ -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()
};