diff options
author | Bastien Bouclet | 2018-06-26 07:10:21 +0200 |
---|---|---|
committer | Bastien Bouclet | 2018-06-29 13:31:55 +0200 |
commit | 573fa47f948a4ce55cfbca4837eda9303cd43d93 (patch) | |
tree | 9bfe6796b66897c83e7a67477edfd29073bbdfa2 /engines/mohawk/riven.cpp | |
parent | 1f4d4b01eaeebecbb790b0e6a719577c14a9b470 (diff) | |
download | scummvm-rg350-573fa47f948a4ce55cfbca4837eda9303cd43d93.tar.gz scummvm-rg350-573fa47f948a4ce55cfbca4837eda9303cd43d93.tar.bz2 scummvm-rg350-573fa47f948a4ce55cfbca4837eda9303cd43d93.zip |
MOHAWK: RIVEN: Fix loading autosaves saved while on the main menu
Diffstat (limited to 'engines/mohawk/riven.cpp')
-rw-r--r-- | engines/mohawk/riven.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/engines/mohawk/riven.cpp b/engines/mohawk/riven.cpp index 252c994437..163785ee72 100644 --- a/engines/mohawk/riven.cpp +++ b/engines/mohawk/riven.cpp @@ -679,13 +679,17 @@ void MohawkEngine_Riven::loadGameStateAndDisplayError(int slot) { } Common::Error MohawkEngine_Riven::saveGameState(int slot, const Common::String &desc) { + return saveGameState(slot, desc, false); +} + +Common::Error MohawkEngine_Riven::saveGameState(int slot, const Common::String &desc, bool autosave) { if (_menuSavedStack != -1) { _vars["CurrentStackID"] = _menuSavedStack; _vars["CurrentCardID"] = _menuSavedCard; } const Graphics::Surface *thumbnail = _menuSavedStack != -1 ? _menuTumbnail.get() : nullptr; - Common::Error error = _saveLoad->saveGame(slot, desc, thumbnail, false); + Common::Error error = _saveLoad->saveGame(slot, desc, thumbnail, autosave); if (_menuSavedStack != -1) { _vars["CurrentStackID"] = 1; @@ -717,8 +721,7 @@ void MohawkEngine_Riven::tryAutoSaving() { return; // Can't autosave ever, try again after the next autosave delay } - const Graphics::Surface *thumbnail = _menuSavedStack != -1 ? _menuTumbnail.get() : nullptr; - Common::Error saveError = _saveLoad->saveGame(RivenSaveLoad::kAutoSaveSlot, "Autosave", thumbnail, true); + Common::Error saveError = saveGameState(RivenSaveLoad::kAutoSaveSlot, "Autosave", true); if (saveError.getCode() != Common::kNoError) warning("Attempt to autosave has failed."); } |