From d42d7ad6c52ad90c53b510f10611cbbb6eb56f5b Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Mon, 2 Aug 2010 21:44:41 +0000 Subject: SCI: allowing kCheckSaveGame with id 0 qfg2 - when trying to restore from an empty saved game list svn-id: r51663 --- engines/sci/engine/kfile.cpp | 6 +++++- engines/sci/engine/workarounds.cpp | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp index 4f0ad12285..39c32ccc68 100644 --- a/engines/sci/engine/kfile.cpp +++ b/engines/sci/engine/kfile.cpp @@ -488,6 +488,10 @@ reg_t kCheckSaveGame(EngineState *s, int argc, reg_t *argv) { Common::Array saves; listSavegames(saves); + // we allow 0 (happens in QfG2 when trying to restore from an empty saved game list) and return false in that case + if (virtualId == 0) + return NULL_REG; + // Find saved-game if ((virtualId < SAVEGAMEID_OFFICIALRANGE_START) || (virtualId > SAVEGAMEID_OFFICIALRANGE_END)) error("kCheckSaveGame: called with invalid savegameId!"); @@ -502,7 +506,7 @@ reg_t kCheckSaveGame(EngineState *s, int argc, reg_t *argv) { return NULL_REG; // Otherwise we assume the savegame is OK - return make_reg(0, 1); + return TRUE_REG; } reg_t kGetSaveFiles(EngineState *s, int argc, reg_t *argv) { diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp index d8ea7ff7e1..336dd5343b 100644 --- a/engines/sci/engine/workarounds.cpp +++ b/engines/sci/engine/workarounds.cpp @@ -111,7 +111,7 @@ const SciWorkaroundEntry uninitializedReadWorkarounds[] = { { GID_QFG1, -1, 210, 0, "Encounter", "init", 0xbe4, 0, { WORKAROUND_FAKE, 0 } }, // qfg1: going to the brigands hideout { GID_QFG2, -1, 71, 0, "theInvSheet", "doit", -1, 1, { WORKAROUND_FAKE, 0 } }, // accessing the inventory { GID_QFG2, -1, 701, -1, "Alley", "at", -1, 0, { WORKAROUND_FAKE, 0 } }, // when walking inside the alleys in the town - bug #3035835 & #3038367 - { GID_QFG2, -1, 990, 0, "Restore", "doit", -1, 0, { WORKAROUND_FAKE, 0 } }, // when press enter in restore dialog w/o any saved games present + { GID_QFG2, -1, 990, 0, "Restore", "doit", -1, 364, { WORKAROUND_FAKE, 0 } }, // when press enter in restore dialog w/o any saved games present { GID_QFG3, 330, 330, 0, "rajahTeller", "doChild", -1, -1, { WORKAROUND_FAKE, 0 } }, // when talking to King Rajah about "Rajah" (bug #3036390, temp 1) or "Tarna" (temp 0) { GID_SQ1, 103, 103, 0, "hand", "internalEvent", -1, -1, { WORKAROUND_FAKE, 0 } }, // Spanish (and maybe early versions?) only: when moving cursor over input pad, temps 1 and 2 { GID_SQ1, -1, 703, 0, "", "export 1", -1, 0, { WORKAROUND_FAKE, 0 } }, // sub that's called from several objects while on sarien battle cruiser -- cgit v1.2.3