diff options
-rw-r--r-- | scumm/saveload.h | 2 | ||||
-rw-r--r-- | scumm/sprite_he.cpp | 12 |
2 files changed, 10 insertions, 4 deletions
diff --git a/scumm/saveload.h b/scumm/saveload.h index ce6639e372..379024a0a5 100644 --- a/scumm/saveload.h +++ b/scumm/saveload.h @@ -45,7 +45,7 @@ namespace Scumm { * only saves/loads those which are valid for the version of the savegame * which is being loaded/saved currently. */ -#define CURRENT_VER 63 +#define CURRENT_VER 64 /** * An auxillary macro, used to specify savegame versions. We use this instead diff --git a/scumm/sprite_he.cpp b/scumm/sprite_he.cpp index 9b1185f6f4..cdcf144ebc 100644 --- a/scumm/sprite_he.cpp +++ b/scumm/sprite_he.cpp @@ -1421,9 +1421,15 @@ void Sprite::saveOrLoadSpriteData(Serializer *s) { MKEND() }; - s->saveLoadArrayOf(_activeSpritesTable, _varNumSprites, sizeof(_activeSpritesTable[0]), spriteEntries); - s->saveLoadArrayOf(_spriteTable, _varNumSprites, sizeof(_spriteTable[0]), spriteEntries); - s->saveLoadArrayOf(_spriteGroups, _varNumSpriteGroups, sizeof(_spriteGroups[0]), spriteGroupEntries); + if (s->getVersion() >= VER(64)) { + s->saveLoadArrayOf(_activeSpritesTable, _varNumSprites + 1, sizeof(_activeSpritesTable[0]), spriteEntries); + s->saveLoadArrayOf(_spriteTable, _varNumSprites + 1, sizeof(_spriteTable[0]), spriteEntries); + s->saveLoadArrayOf(_spriteGroups, _varNumSpriteGroups + 1, sizeof(_spriteGroups[0]), spriteGroupEntries); + } else { + s->saveLoadArrayOf(_activeSpritesTable, _varNumSprites, sizeof(_activeSpritesTable[0]), spriteEntries); + s->saveLoadArrayOf(_spriteTable, _varNumSprites, sizeof(_spriteTable[0]), spriteEntries); + s->saveLoadArrayOf(_spriteGroups, _varNumSpriteGroups, sizeof(_spriteGroups[0]), spriteGroupEntries); + } } } // End of namespace Scumm |