diff options
author | Filippos Karapetis | 2013-05-15 21:48:32 +0300 |
---|---|---|
committer | Filippos Karapetis | 2013-05-15 21:48:32 +0300 |
commit | de230b7696318ea8fb2af593223342a2a619a565 (patch) | |
tree | 78e996e2e10d3d393904e755ef59b23c255c9948 /engines/made | |
parent | 0638308ef13727b4b359d98d54bc09156752aaaa (diff) | |
download | scummvm-rg350-de230b7696318ea8fb2af593223342a2a619a565.tar.gz scummvm-rg350-de230b7696318ea8fb2af593223342a2a619a565.tar.bz2 scummvm-rg350-de230b7696318ea8fb2af593223342a2a619a565.zip |
MADE: Show version-related before size-related incompatibilities in savegames
This gives clearer errors when users use savegames saved with a different version
Diffstat (limited to 'engines/made')
-rw-r--r-- | engines/made/database.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/engines/made/database.cpp b/engines/made/database.cpp index bf47164e8f..7c8f9bdd0c 100644 --- a/engines/made/database.cpp +++ b/engines/made/database.cpp @@ -665,15 +665,16 @@ bool GameDatabaseV3::getSavegameDescription(const char *filename, Common::String } int32 size = in->readUint32LE(); - if (size != in->size() - 64) { - warning("Unexpected save game size. Expected %d, size is %d (file size - 64)", size, in->size() - 64); + int16 saveVersion = in->readUint16LE(); + + if (saveVersion != version) { + warning("Save game %s was saved with a different version of the game. Game version is %d, save version is %d", filename, version, saveVersion); delete in; return false; } - int16 saveVersion = in->readUint16LE(); - if (saveVersion != version) { - warning("Save game %s was saved with a different version of the game. Game version is %d, save version is %d", filename, version, saveVersion); + if (size != in->size() - 64) { + warning("Unexpected save game size. Expected %d, size is %d (file size - 64)", size, in->size() - 64); delete in; return false; } @@ -722,15 +723,16 @@ int16 GameDatabaseV3::loadgame(const char *filename, int16 version) { } uint32 size = in->readUint32LE(); - if (size != expectedSize) { - warning("Unexpected save game size. Expected %d, size is %d", expectedSize, size); + int16 saveVersion = in->readUint16LE(); + + if (saveVersion != version) { + warning("Save game %s was saved with a different version of the game. Game version is %d, save version is %d", filename, version, saveVersion); delete in; return 1; } - int16 saveVersion = in->readUint16LE(); - if (saveVersion != version) { - warning("Save game %s was saved with a different version of the game. Game version is %d, save version is %d", filename, version, saveVersion); + if (size != expectedSize) { + warning("Unexpected save game size. Expected %d, size is %d", expectedSize, size); delete in; return 1; } |