diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sky/sky.cpp | 7 | ||||
-rw-r--r-- | engines/touche/touche.cpp | 11 |
2 files changed, 12 insertions, 6 deletions
diff --git a/engines/sky/sky.cpp b/engines/sky/sky.cpp index 92df584f6f..44347cf9a7 100644 --- a/engines/sky/sky.cpp +++ b/engines/sky/sky.cpp @@ -343,8 +343,11 @@ int SkyEngine::go() { _keyPressed.reset(); uint16 result = 0; - if (ConfMan.hasKey("save_slot") && ConfMan.getInt("save_slot") >= 0) - result = _skyControl->quickXRestore(ConfMan.getInt("save_slot")); + if (ConfMan.hasKey("save_slot")) { + int saveSlot = ConfMan.getInt("save_slot"); + if (saveSlot >= 0 && saveSlot <= 999) + result = _skyControl->quickXRestore(ConfMan.getInt("save_slot")); + } if (result != GAME_RESTORED) { bool introSkipped = false; diff --git a/engines/touche/touche.cpp b/engines/touche/touche.cpp index a4a9b7df92..a7a362f2b1 100644 --- a/engines/touche/touche.cpp +++ b/engines/touche/touche.cpp @@ -252,10 +252,13 @@ void ToucheEngine::mainLoop() { _inp_rightMouseButtonPressed = false; if (ConfMan.hasKey("save_slot")) { - loadGameState(ConfMan.getInt("save_slot")); - _newEpisodeNum = 0; - resetSortedKeyCharsTable(); - showCursor(true); + int saveSlot = ConfMan.getInt("save_slot"); + if (saveSlot >= 0 && saveSlot <= 99) { + loadGameState(saveSlot); + _newEpisodeNum = 0; + resetSortedKeyCharsTable(); + showCursor(true); + } } else { _newEpisodeNum = ConfMan.getInt("boot_param"); if (_newEpisodeNum == 0) { |