[Scummvm-cvs-logs] SF.net SVN: scummvm:[33483] scummvm/branches/gsoc2008-rtl/engines
cpage88 at users.sourceforge.net
cpage88 at users.sourceforge.net
Thu Jul 31 23:56:07 CEST 2008
Revision: 33483
http://scummvm.svn.sourceforge.net/scummvm/?rev=33483&view=rev
Author: cpage88
Date: 2008-07-31 21:56:05 +0000 (Thu, 31 Jul 2008)
Log Message:
-----------
Added check for valid save slots, when loading savestates using -x
Modified Paths:
--------------
scummvm/branches/gsoc2008-rtl/engines/sky/sky.cpp
scummvm/branches/gsoc2008-rtl/engines/touche/touche.cpp
Modified: scummvm/branches/gsoc2008-rtl/engines/sky/sky.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/sky/sky.cpp 2008-07-31 21:13:02 UTC (rev 33482)
+++ scummvm/branches/gsoc2008-rtl/engines/sky/sky.cpp 2008-07-31 21:56:05 UTC (rev 33483)
@@ -343,8 +343,11 @@
_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;
Modified: scummvm/branches/gsoc2008-rtl/engines/touche/touche.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/touche/touche.cpp 2008-07-31 21:13:02 UTC (rev 33482)
+++ scummvm/branches/gsoc2008-rtl/engines/touche/touche.cpp 2008-07-31 21:56:05 UTC (rev 33483)
@@ -252,10 +252,13 @@
_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) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list