aboutsummaryrefslogtreecommitdiff
path: root/engines/cge/events.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2011-11-08 20:37:14 +1100
committerPaul Gilbert2011-11-08 20:37:14 +1100
commit09a48a08789502a619e3512135fd29729319932f (patch)
treedbd84eee8da3485355fbb0b5df216ab6e10e6dfb /engines/cge/events.cpp
parentb1c10ef2f05bbad9c907c4a4f8d120ca84734642 (diff)
downloadscummvm-rg350-09a48a08789502a619e3512135fd29729319932f.tar.gz
scummvm-rg350-09a48a08789502a619e3512135fd29729319932f.tar.bz2
scummvm-rg350-09a48a08789502a619e3512135fd29729319932f.zip
CGE: Bugfixes for the save/load game keys
Diffstat (limited to 'engines/cge/events.cpp')
-rw-r--r--engines/cge/events.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/engines/cge/events.cpp b/engines/cge/events.cpp
index cc22d9075a..2c134baf92 100644
--- a/engines/cge/events.cpp
+++ b/engines/cge/events.cpp
@@ -113,7 +113,6 @@ bool Keyboard::getKey(Common::Event &event, int &cgeCode) {
return true;
}
if (keycode == Common::KEYCODE_F5) {
- warning("keycode %d", event.kbd.ascii);
if (_vm->canSaveGameStateCurrently()) {
const EnginePlugin *plugin = NULL;
EngineMan.findGame(_vm->_gameDescription->gameid, &plugin);
@@ -123,7 +122,9 @@ bool Keyboard::getKey(Common::Event &event, int &cgeCode) {
int16 savegameId = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
Common::String savegameDescription = dialog->getResultString();
delete dialog;
- _vm->saveGameState(savegameId, savegameDescription);
+
+ if (savegameId != -1)
+ _vm->saveGameState(savegameId, savegameDescription);
}
return false;
} else if (keycode == Common::KEYCODE_F7) {
@@ -135,7 +136,9 @@ bool Keyboard::getKey(Common::Event &event, int &cgeCode) {
dialog->setSaveMode(false);
int16 savegameId = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
delete dialog;
- _vm->loadGameState(savegameId);
+
+ if (savegameId != -1)
+ _vm->loadGameState(savegameId);
}
return false;
}