diff options
author | Bastien Bouclet | 2016-02-26 07:17:37 +0100 |
---|---|---|
committer | Bastien Bouclet | 2016-02-26 07:22:30 +0100 |
commit | faff49d001bfaa4a6cce45509b4f80fe3ea0ea6f (patch) | |
tree | 9974c53399598017a174698096eb00795502a54e /engines | |
parent | 2a98be9f350d136cdcc956cd4df200df6cecd9a7 (diff) | |
download | scummvm-rg350-faff49d001bfaa4a6cce45509b4f80fe3ea0ea6f.tar.gz scummvm-rg350-faff49d001bfaa4a6cce45509b4f80fe3ea0ea6f.tar.bz2 scummvm-rg350-faff49d001bfaa4a6cce45509b4f80fe3ea0ea6f.zip |
MOHAWK: Fix loading a save from the launcher
Was broken by d6881100dd5613c8573f8f8235b93772ae513e49
Diffstat (limited to 'engines')
-rw-r--r-- | engines/mohawk/myst.cpp | 8 | ||||
-rw-r--r-- | engines/mohawk/myst.h | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp index ad803cca7c..e0e8380cba 100644 --- a/engines/mohawk/myst.cpp +++ b/engines/mohawk/myst.cpp @@ -235,7 +235,7 @@ Common::Error MohawkEngine_Myst::run() { _cursor->showCursor(); // Load game from launcher/command line if requested - if (ConfMan.hasKey("save_slot") && canLoadGameStateCurrently()) { + if (ConfMan.hasKey("save_slot") && hasGameSaveSupport()) { uint32 gameToLoad = ConfMan.getInt("save_slot"); Common::StringArray savedGamesList = MystGameState::generateSaveGameList(); if (gameToLoad > savedGamesList.size()) @@ -1093,9 +1093,13 @@ Common::Error MohawkEngine_Myst::saveGameState(int slot, const Common::String &d return _gameState->save(desc) ? Common::kNoError : Common::kUnknownError; } +bool MohawkEngine_Myst::hasGameSaveSupport() const { + return !(getFeatures() & GF_DEMO) && getGameType() != GType_MAKINGOF; +} + bool MohawkEngine_Myst::canLoadGameStateCurrently() { // No loading in the demo/makingof - return _canSafelySaveLoad && !(getFeatures() & GF_DEMO) && getGameType() != GType_MAKINGOF; + return _canSafelySaveLoad && hasGameSaveSupport(); } bool MohawkEngine_Myst::canSaveGameStateCurrently() { diff --git a/engines/mohawk/myst.h b/engines/mohawk/myst.h index 79bd0819cb..0803c69e55 100644 --- a/engines/mohawk/myst.h +++ b/engines/mohawk/myst.h @@ -245,6 +245,7 @@ private: * Saving / Loading is only allowed from the main event loop */ bool _canSafelySaveLoad; + bool hasGameSaveSupport() const; bool pollEvent(Common::Event &event); |