Skip to content

Commit

Permalink
MOHAWK: Fix loading a save from the launcher
Browse files Browse the repository at this point in the history
Was broken by d688110
  • Loading branch information
bgK committed Feb 26, 2016
1 parent 2a98be9 commit faff49d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions engines/mohawk/myst.cpp
Expand Up @@ -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())
Expand Down Expand Up @@ -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() {
Expand Down
1 change: 1 addition & 0 deletions engines/mohawk/myst.h
Expand Up @@ -245,6 +245,7 @@ class MohawkEngine_Myst : public MohawkEngine {
* Saving / Loading is only allowed from the main event loop
*/
bool _canSafelySaveLoad;
bool hasGameSaveSupport() const;

bool pollEvent(Common::Event &event);

Expand Down

0 comments on commit faff49d

Please sign in to comment.