aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorOri Avtalion2015-10-05 18:51:15 +0300
committerOri Avtalion2015-10-05 18:51:15 +0300
commit923ee223d82be96a3c2e0c4fbb79bb86e1947bd5 (patch)
treec0ac792ff53c048cb9ef00a150dbb36a4344f781 /engines
parente73a50c6c53bffcf10f044377a72cf754b524bf9 (diff)
downloadscummvm-rg350-923ee223d82be96a3c2e0c4fbb79bb86e1947bd5.tar.gz
scummvm-rg350-923ee223d82be96a3c2e0c4fbb79bb86e1947bd5.tar.bz2
scummvm-rg350-923ee223d82be96a3c2e0c4fbb79bb86e1947bd5.zip
NEVERHOOD: Don't crash when loading savegames with a high slot ID
Diffstat (limited to 'engines')
-rw-r--r--engines/neverhood/menumodule.cpp6
-rw-r--r--engines/neverhood/menumodule.h1
2 files changed, 6 insertions, 1 deletions
diff --git a/engines/neverhood/menumodule.cpp b/engines/neverhood/menumodule.cpp
index 6911041e58..826f175d47 100644
--- a/engines/neverhood/menumodule.cpp
+++ b/engines/neverhood/menumodule.cpp
@@ -93,6 +93,10 @@ void MenuModule::setLoadgameInfo(uint index) {
_savegameSlot = (*_savegameList)[index].slotNum;
}
+void MenuModule::setLoadgameSlot(int slot) {
+ _savegameSlot = slot;
+}
+
void MenuModule::setSavegameInfo(const Common::String &description, uint index, bool newSavegame) {
_savegameDescription = description;
_savegameSlot = newSavegame ? -1 : (*_savegameList)[index].slotNum;
@@ -912,7 +916,7 @@ GameStateMenu::GameStateMenu(NeverhoodEngine *vm, Module *parentModule, Savegame
if (slot >= 0) {
if (!isSave) {
- ((MenuModule*)_parentModule)->setLoadgameInfo(slot);
+ ((MenuModule*)_parentModule)->setLoadgameSlot(slot);
} else {
((MenuModule*)_parentModule)->setSavegameInfo(saveDesc,
slot, slot >= saveCount);
diff --git a/engines/neverhood/menumodule.h b/engines/neverhood/menumodule.h
index 6508ccbdf2..1c4ade2369 100644
--- a/engines/neverhood/menumodule.h
+++ b/engines/neverhood/menumodule.h
@@ -43,6 +43,7 @@ public:
MenuModule(NeverhoodEngine *vm, Module *parentModule, int which);
virtual ~MenuModule();
void setLoadgameInfo(uint index);
+ void setLoadgameSlot(int slot);
void setSavegameInfo(const Common::String &description, uint index, bool newSavegame);
void setDeletegameInfo(uint index);
void refreshSaveGameList();