diff options
author | Strangerke | 2013-09-11 21:33:10 +0200 |
---|---|---|
committer | Strangerke | 2013-09-11 21:33:10 +0200 |
commit | da1a427e794434a09cd39ab45e32ae7afca9a170 (patch) | |
tree | 85b4700515bc7853e4f90ddae22bc3b785c4ab3a /engines/mortevielle/saveload.cpp | |
parent | 49dbac6a2a5cde294a4c4c9a47467e7b5d95e08b (diff) | |
parent | 5c6ee7573c0cf05bbbb154d4734e94e478f453e5 (diff) | |
download | scummvm-rg350-da1a427e794434a09cd39ab45e32ae7afca9a170.tar.gz scummvm-rg350-da1a427e794434a09cd39ab45e32ae7afca9a170.tar.bz2 scummvm-rg350-da1a427e794434a09cd39ab45e32ae7afca9a170.zip |
Merge branch 'master' of https://github.com/urukgit/scummvm into avalanche
Diffstat (limited to 'engines/mortevielle/saveload.cpp')
-rw-r--r-- | engines/mortevielle/saveload.cpp | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp index 651ed07b65..c14a03cd60 100644 --- a/engines/mortevielle/saveload.cpp +++ b/engines/mortevielle/saveload.cpp @@ -72,15 +72,16 @@ void SavegameManager::sync_save(Common::Serializer &sz) { * Inner code for loading a saved game * @remarks Originally called 'takesav' */ -void SavegameManager::loadSavegame(const Common::String &filename) { +bool SavegameManager::loadSavegame(const Common::String &filename) { // Try loading first from the save area Common::SeekableReadStream *stream = g_system->getSavefileManager()->openForLoading(filename); Common::File f; if (stream == NULL) { - if (!f.open(filename)) - error("Unable to open save file '%s'", filename.c_str()); - + if (!f.open(filename)) { + warning("Unable to open save file '%s'", filename.c_str()); + return false; + } stream = f.readStream(f.size()); f.close(); } @@ -107,6 +108,8 @@ void SavegameManager::loadSavegame(const Common::String &filename) { // Close the stream delete stream; + + return true; } /** @@ -115,14 +118,15 @@ void SavegameManager::loadSavegame(const Common::String &filename) { Common::Error SavegameManager::loadGame(const Common::String &filename) { g_vm->_mouse.hideMouse(); g_vm->displayEmptyHand(); - loadSavegame(filename); - - /* Initialization */ - g_vm->charToHour(); - g_vm->initGame(); - g_vm->gameLoaded(); - g_vm->_mouse.showMouse(); - return Common::kNoError; + if (loadSavegame(filename)) { + /* Initialization */ + g_vm->charToHour(); + g_vm->initGame(); + g_vm->gameLoaded(); + g_vm->_mouse.showMouse(); + return Common::kNoError; + } else + return Common::kUnknownError; } /** |