diff options
author | eriktorbjorn | 2011-06-22 22:00:59 +0200 |
---|---|---|
committer | eriktorbjorn | 2011-06-22 22:00:59 +0200 |
commit | afdfff02f1415f66856f273fcf9f30d7621d8953 (patch) | |
tree | 65009d372106c6061d2cc7d5a45fc72574aedf89 | |
parent | cb37f4517baa4435c7cc0774d5a830173a6dc0db (diff) | |
download | scummvm-rg350-afdfff02f1415f66856f273fcf9f30d7621d8953.tar.gz scummvm-rg350-afdfff02f1415f66856f273fcf9f30d7621d8953.tar.bz2 scummvm-rg350-afdfff02f1415f66856f273fcf9f30d7621d8953.zip |
TSAGE: Don't crash if -x option points to an non-existing savegame.
Instead, just pretend there is no spoon^H^H^H^H^H-x option.
-rw-r--r-- | engines/tsage/ringworld_logic.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/engines/tsage/ringworld_logic.cpp b/engines/tsage/ringworld_logic.cpp index 1dd905b3b6..58501172af 100644 --- a/engines/tsage/ringworld_logic.cpp +++ b/engines/tsage/ringworld_logic.cpp @@ -1333,9 +1333,20 @@ void RingworldGame::start() { RING_INVENTORY._scanner._sceneNumber = 1; RING_INVENTORY._ring._sceneNumber = 1; + int slot = -1; + + if (ConfMan.hasKey("save_slot")) { + slot = ConfMan.getInt("save_slot"); + Common::String file = _vm->generateSaveName(slot); + Common::InSaveFile *in = _vm->_system->getSavefileManager()->openForLoading(file); + if (in) + delete in; + else + slot = -1; + } - if (ConfMan.hasKey("save_slot")) - _globals->_sceneHandler._loadGameSlot = ConfMan.getInt("save_slot"); + if (slot >= 0) + _globals->_sceneHandler._loadGameSlot = slot; else // Switch to the title screen _globals->_sceneManager.setNewScene(1000); |