aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorChristopher Page2008-07-31 21:56:05 +0000
committerChristopher Page2008-07-31 21:56:05 +0000
commita51f45407659bba43254b466d20b6af2e8f17ffd (patch)
tree3c2442a87ffefca513d5091e77c0d2f2cdeb026d /engines
parent8721102dedd1eb60d5ff2e0452b669e9fcd88f96 (diff)
downloadscummvm-rg350-a51f45407659bba43254b466d20b6af2e8f17ffd.tar.gz
scummvm-rg350-a51f45407659bba43254b466d20b6af2e8f17ffd.tar.bz2
scummvm-rg350-a51f45407659bba43254b466d20b6af2e8f17ffd.zip
Added check for valid save slots, when loading savestates using -x
svn-id: r33483
Diffstat (limited to 'engines')
-rw-r--r--engines/sky/sky.cpp7
-rw-r--r--engines/touche/touche.cpp11
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) {