From e5ecd500cfbf1c91da31dab0a5a71ff43ed82033 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 21 Dec 2014 23:33:48 +0200 Subject: ZVISION: Document some controls that are only used in Zork: Nemesis --- engines/zvision/scripting/scr_file_handling.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'engines/zvision/scripting/scr_file_handling.cpp') diff --git a/engines/zvision/scripting/scr_file_handling.cpp b/engines/zvision/scripting/scr_file_handling.cpp index c117da5ec2..47b8b0aa39 100644 --- a/engines/zvision/scripting/scr_file_handling.cpp +++ b/engines/zvision/scripting/scr_file_handling.cpp @@ -358,12 +358,16 @@ Control *ScriptManager::parseControl(Common::String &line, Common::SeekableReadS } else if (controlType.equalsIgnoreCase("safe")) { return new SafeControl(_engine, key, stream); } else if (controlType.equalsIgnoreCase("hotmovie")) { + // Only used in Zork Nemesis, it handles movies where the player needs to click on something (mj7g, vw3g) return new HotMovControl(_engine, key, stream); } else if (controlType.equalsIgnoreCase("fist")) { + // Only used in Zork Nemesis, it handles the door lock puzzle with the skeletal fingers (td60, td90, td9e) return new FistControl(_engine, key, stream); } else if (controlType.equalsIgnoreCase("paint")) { + // Only used in Zork Nemesis, it's the painting puzzle screen in Lucien's room in Irondune (ch4g) return new PaintControl(_engine, key, stream); } else if (controlType.equalsIgnoreCase("titler")) { + // Only used in Zork Nemesis - it's the death screen with the Restore/Exit buttons (cjde) return new TitlerControl(_engine, key, stream); } return NULL; -- cgit v1.2.3 From 319323c668003b284d51b84ec95a64ba7c072450 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 25 Dec 2014 15:00:49 +0200 Subject: ZVISION: Document some of the ActionRegion effects --- engines/zvision/scripting/scr_file_handling.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/zvision/scripting/scr_file_handling.cpp') diff --git a/engines/zvision/scripting/scr_file_handling.cpp b/engines/zvision/scripting/scr_file_handling.cpp index 47b8b0aa39..cca492d649 100644 --- a/engines/zvision/scripting/scr_file_handling.cpp +++ b/engines/zvision/scripting/scr_file_handling.cpp @@ -264,6 +264,7 @@ void ScriptManager::parseResults(Common::SeekableReadStream &stream, Common::Lis } else if (act.matchString("random", true)) { actionList.push_back(new ActionRandom(_engine, slot, args)); } else if (act.matchString("region", true)) { + // Only used by Zork: Nemesis actionList.push_back(new ActionRegion(_engine, slot, args)); } else if (act.matchString("restore_game", true)) { actionList.push_back(new ActionRestoreGame(_engine, slot, args)); -- cgit v1.2.3 From 5535cb02fc8dfaf2c77911c223c912f5b07bdb63 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 25 Dec 2014 15:14:59 +0200 Subject: ZVISION: Resolve some TODOs --- engines/zvision/scripting/scr_file_handling.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/zvision/scripting/scr_file_handling.cpp') diff --git a/engines/zvision/scripting/scr_file_handling.cpp b/engines/zvision/scripting/scr_file_handling.cpp index cca492d649..83be3b5ad4 100644 --- a/engines/zvision/scripting/scr_file_handling.cpp +++ b/engines/zvision/scripting/scr_file_handling.cpp @@ -216,6 +216,7 @@ void ScriptManager::parseResults(Common::SeekableReadStream &stream, Common::Lis } else if (act.matchString("animpreload", true)) { actionList.push_back(new ActionPreloadAnimation(_engine, slot, args)); } else if (act.matchString("animunload", true)) { + // Only used by ZGI (locations cd6e, cd6k, dg2f, dg4e, dv1j) actionList.push_back(new ActionUnloadAnimation(_engine, slot, args)); } else if (act.matchString("attenuate", true)) { actionList.push_back(new ActionAttenuate(_engine, slot, args)); -- cgit v1.2.3 From 2350eca546396775c6e9ac9875ebd59bcc17663f Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 26 Dec 2014 12:04:21 +0200 Subject: ZVISION: Remove some unused actions. Cleanup --- engines/zvision/scripting/scr_file_handling.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'engines/zvision/scripting/scr_file_handling.cpp') diff --git a/engines/zvision/scripting/scr_file_handling.cpp b/engines/zvision/scripting/scr_file_handling.cpp index 83be3b5ad4..fd5c158fcc 100644 --- a/engines/zvision/scripting/scr_file_handling.cpp +++ b/engines/zvision/scripting/scr_file_handling.cpp @@ -235,12 +235,13 @@ void ScriptManager::parseResults(Common::SeekableReadStream &stream, Common::Lis } else if (act.matchString("disable_control", true)) { actionList.push_back(new ActionDisableControl(_engine, slot, args)); } else if (act.matchString("disable_venus", true)) { - actionList.push_back(new ActionDisableVenus(_engine, slot, args)); + // Not used. Purposely left empty } else if (act.matchString("display_message", true)) { actionList.push_back(new ActionDisplayMessage(_engine, slot, args)); } else if (act.matchString("dissolve", true)) { actionList.push_back(new ActionDissolve(_engine)); } else if (act.matchString("distort", true)) { + // Only used by Zork: Nemesis for the "treatment" puzzle in the Sanitarium (aj30) actionList.push_back(new ActionDistort(_engine, slot, args)); } else if (act.matchString("enable_control", true)) { actionList.push_back(new ActionEnableControl(_engine, slot, args)); @@ -249,6 +250,7 @@ void ScriptManager::parseResults(Common::SeekableReadStream &stream, Common::Lis } else if (act.matchString("inventory", true)) { actionList.push_back(new ActionInventory(_engine, slot, args)); } else if (act.matchString("kill", true)) { + // Only used by ZGI actionList.push_back(new ActionKill(_engine, slot, args)); } else if (act.matchString("menu_bar_enable", true)) { actionList.push_back(new ActionMenuBarEnable(_engine, slot, args)); @@ -278,7 +280,7 @@ void ScriptManager::parseResults(Common::SeekableReadStream &stream, Common::Lis } else if (act.matchString("set_screen", true)) { actionList.push_back(new ActionSetScreen(_engine, slot, args)); } else if (act.matchString("set_venus", true)) { - actionList.push_back(new ActionSetVenus(_engine, slot, args)); + // Not used. Purposely left empty } else if (act.matchString("stop", true)) { actionList.push_back(new ActionStop(_engine, slot, args)); } else if (act.matchString("streamvideo", true)) { -- cgit v1.2.3 From 78b2c87d510f1ad83e8915e15b7e345a2512d99a Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 28 Dec 2014 15:27:55 +0200 Subject: ZVISION: Document some more controls --- engines/zvision/scripting/scr_file_handling.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'engines/zvision/scripting/scr_file_handling.cpp') diff --git a/engines/zvision/scripting/scr_file_handling.cpp b/engines/zvision/scripting/scr_file_handling.cpp index fd5c158fcc..4e8c8a6b33 100644 --- a/engines/zvision/scripting/scr_file_handling.cpp +++ b/engines/zvision/scripting/scr_file_handling.cpp @@ -349,29 +349,32 @@ Control *ScriptManager::parseControl(Common::String &line, Common::SeekableReadS Control::parsePanoramaControl(_engine, stream); return NULL; } else if (controlType.equalsIgnoreCase("tilt")) { + // Only used in Zork Nemesis, handles tilt controls (ZGI doesn't have a tilt view) Control::parseTiltControl(_engine, stream); return NULL; - } else if (controlType.equalsIgnoreCase("lever")) { - return new LeverControl(_engine, key, stream); } else if (controlType.equalsIgnoreCase("slot")) { return new SlotControl(_engine, key, stream); } else if (controlType.equalsIgnoreCase("input")) { return new InputControl(_engine, key, stream); } else if (controlType.equalsIgnoreCase("save")) { return new SaveControl(_engine, key, stream); + } else if (controlType.equalsIgnoreCase("lever")) { + // Only used in Zork Nemesis, handles draggable levers (te2e, tm7e, tp2e, tt2e, tz2e) + return new LeverControl(_engine, key, stream); } else if (controlType.equalsIgnoreCase("safe")) { + // Only used in Zork Nemesis, handles the safe in the Asylum (ac4g) return new SafeControl(_engine, key, stream); } else if (controlType.equalsIgnoreCase("hotmovie")) { - // Only used in Zork Nemesis, it handles movies where the player needs to click on something (mj7g, vw3g) + // Only used in Zork Nemesis, handles movies where the player needs to click on something (mj7g, vw3g) return new HotMovControl(_engine, key, stream); } else if (controlType.equalsIgnoreCase("fist")) { - // Only used in Zork Nemesis, it handles the door lock puzzle with the skeletal fingers (td60, td90, td9e) + // Only used in Zork Nemesis, handles the door lock puzzle with the skeletal fingers (td60, td90, td9e) return new FistControl(_engine, key, stream); } else if (controlType.equalsIgnoreCase("paint")) { - // Only used in Zork Nemesis, it's the painting puzzle screen in Lucien's room in Irondune (ch4g) + // Only used in Zork Nemesis, handles the painting puzzle screen in Lucien's room in Irondune (ch4g) return new PaintControl(_engine, key, stream); } else if (controlType.equalsIgnoreCase("titler")) { - // Only used in Zork Nemesis - it's the death screen with the Restore/Exit buttons (cjde) + // Only used in Zork Nemesis, handles the death screen with the Restore/Exit buttons (cjde) return new TitlerControl(_engine, key, stream); } return NULL; -- cgit v1.2.3 From 587b1ad69c200ee5b5c987328a65bd8092d9ea4f Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 28 Dec 2014 18:42:18 +0200 Subject: ZVISION: The fist control is only used in one location --- engines/zvision/scripting/scr_file_handling.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/zvision/scripting/scr_file_handling.cpp') diff --git a/engines/zvision/scripting/scr_file_handling.cpp b/engines/zvision/scripting/scr_file_handling.cpp index 4e8c8a6b33..227c43557c 100644 --- a/engines/zvision/scripting/scr_file_handling.cpp +++ b/engines/zvision/scripting/scr_file_handling.cpp @@ -368,7 +368,7 @@ Control *ScriptManager::parseControl(Common::String &line, Common::SeekableReadS // Only used in Zork Nemesis, handles movies where the player needs to click on something (mj7g, vw3g) return new HotMovControl(_engine, key, stream); } else if (controlType.equalsIgnoreCase("fist")) { - // Only used in Zork Nemesis, handles the door lock puzzle with the skeletal fingers (td60, td90, td9e) + // Only used in Zork Nemesis, handles the door lock puzzle with the skeletal fingers (td9e) return new FistControl(_engine, key, stream); } else if (controlType.equalsIgnoreCase("paint")) { // Only used in Zork Nemesis, handles the painting puzzle screen in Lucien's room in Irondune (ch4g) -- cgit v1.2.3 From 9f642074ba8e17aa23b01bcee82b2293fe84f8f1 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 2 Jan 2015 04:52:53 +0200 Subject: ZVISION: Remove ActionRestoreGame and loading of r.svr (restart slot) This is handled internally now, so r.svr isn't needed anymore --- engines/zvision/scripting/scr_file_handling.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines/zvision/scripting/scr_file_handling.cpp') diff --git a/engines/zvision/scripting/scr_file_handling.cpp b/engines/zvision/scripting/scr_file_handling.cpp index 227c43557c..7856bf7b2e 100644 --- a/engines/zvision/scripting/scr_file_handling.cpp +++ b/engines/zvision/scripting/scr_file_handling.cpp @@ -270,7 +270,9 @@ void ScriptManager::parseResults(Common::SeekableReadStream &stream, Common::Lis // Only used by Zork: Nemesis actionList.push_back(new ActionRegion(_engine, slot, args)); } else if (act.matchString("restore_game", true)) { - actionList.push_back(new ActionRestoreGame(_engine, slot, args)); + // Only used by ZGI to load the restart game slot, r.svr. + _engine->getScriptManager()->reset(); + _engine->getScriptManager()->changeLocation('g', 'a', 'r', 'y', 0); } else if (act.matchString("rotate_to", true)) { actionList.push_back(new ActionRotateTo(_engine, slot, args)); } else if (act.matchString("save_game", true)) { -- cgit v1.2.3 From 21e9007d80ee60e519896c330324e5e3a95f772f Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 10 Jan 2015 22:03:15 +0200 Subject: Revert "ZVISION: Remove ActionRestoreGame and loading of r.svr (restart slot)" This reverts commit 9f642074ba8e17aa23b01bcee82b2293fe84f8f1, as it broke the credits screen in ZGI. This has been rewritten to use the common save code --- engines/zvision/scripting/scr_file_handling.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/zvision/scripting/scr_file_handling.cpp') diff --git a/engines/zvision/scripting/scr_file_handling.cpp b/engines/zvision/scripting/scr_file_handling.cpp index 7856bf7b2e..b4da61a119 100644 --- a/engines/zvision/scripting/scr_file_handling.cpp +++ b/engines/zvision/scripting/scr_file_handling.cpp @@ -271,8 +271,8 @@ void ScriptManager::parseResults(Common::SeekableReadStream &stream, Common::Lis actionList.push_back(new ActionRegion(_engine, slot, args)); } else if (act.matchString("restore_game", true)) { // Only used by ZGI to load the restart game slot, r.svr. - _engine->getScriptManager()->reset(); - _engine->getScriptManager()->changeLocation('g', 'a', 'r', 'y', 0); + // Used by the credits screen. + actionList.push_back(new ActionRestoreGame(_engine, slot, args)); } else if (act.matchString("rotate_to", true)) { actionList.push_back(new ActionRotateTo(_engine, slot, args)); } else if (act.matchString("save_game", true)) { -- cgit v1.2.3 From 750d72812b36bfed3043080d633798854dc4008d Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 20 Jan 2015 02:16:21 +0200 Subject: ZVISION: Properly skip commented out puzzle criteria - fixes bug #6776 In the Zork: Nemesis version bundled in the ZGI SE DVD, the bell rope puzzle has been modified so that it's non-interactive, i.e. there isn't a hotspot to click while the video is playing, and the player is transported to the next room. In the patched script, all criteria of that puzzle were commented out, resulting in an invalid criteria list. Skip any commented out criteria, to avoid ending with an invalid list. --- engines/zvision/scripting/scr_file_handling.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'engines/zvision/scripting/scr_file_handling.cpp') diff --git a/engines/zvision/scripting/scr_file_handling.cpp b/engines/zvision/scripting/scr_file_handling.cpp index b4da61a119..277702d287 100644 --- a/engines/zvision/scripting/scr_file_handling.cpp +++ b/engines/zvision/scripting/scr_file_handling.cpp @@ -104,6 +104,13 @@ bool ScriptManager::parseCriteria(Common::SeekableReadStream &stream, Common::Li Common::String line = stream.readLine(); trimCommentsAndWhiteSpace(&line); + // Skip any commented out criteria. If all the criteria are commented out, + // we might end up with an invalid criteria list (bug #6776). + while (line.empty()) { + line = stream.readLine(); + trimCommentsAndWhiteSpace(&line); + } + // Criteria can be empty if (line.contains('}')) { return false; -- cgit v1.2.3 From ad83f033151ac6cf6345e6a83a0903ad6499c0ca Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Tue, 20 Jan 2015 19:21:39 +0100 Subject: ZVISION: Fix mis-parsing of criteria, a.k.a bug #6774 A condition in a criteria is made up of three tokens: An id, an operator and an id/value. However, in my copy of ZGI, puzzle:07507 has "[00202] !3 # SPELL_12_IN_BOOK", i.e. there was no space between the second and third tokens. This caused the "glorf" spell to not be properly inscribed in your spell book. To fix this, if the second token is more than one character we use the rest of it as the third token. --- engines/zvision/scripting/scr_file_handling.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'engines/zvision/scripting/scr_file_handling.cpp') diff --git a/engines/zvision/scripting/scr_file_handling.cpp b/engines/zvision/scripting/scr_file_handling.cpp index 277702d287..8f0f80e39e 100644 --- a/engines/zvision/scripting/scr_file_handling.cpp +++ b/engines/zvision/scripting/scr_file_handling.cpp @@ -141,9 +141,17 @@ bool ScriptManager::parseCriteria(Common::SeekableReadStream &stream, Common::Li else if (token.c_str()[0] == '<') entry.criteriaOperator = Puzzle::LESS_THAN; + // There are supposed to be three tokens, but there is no + // guarantee that there will be a space between the second and + // the third one (bug #6774) + if (token.size() == 1) { + token = tokenizer.nextToken(); + } else { + token.deleteChar(0); + } + // First determine if the last token is an id or a value // Then parse it into 'argument' - token = tokenizer.nextToken(); if (token.contains('[')) { sscanf(token.c_str(), "[%u]", &(entry.argument)); entry.argumentIsAKey = true; -- cgit v1.2.3 From 1bd83a96f00c4d25cf4060ba8faffda81865ad7d Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 23 Jan 2015 03:02:24 +0200 Subject: ZVISION: Fix script bug #6780 (invalid hotspot at base of tower in ZGI) --- engines/zvision/scripting/scr_file_handling.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'engines/zvision/scripting/scr_file_handling.cpp') diff --git a/engines/zvision/scripting/scr_file_handling.cpp b/engines/zvision/scripting/scr_file_handling.cpp index 8f0f80e39e..b9cafa77ed 100644 --- a/engines/zvision/scripting/scr_file_handling.cpp +++ b/engines/zvision/scripting/scr_file_handling.cpp @@ -358,6 +358,16 @@ Control *ScriptManager::parseControl(Common::String &line, Common::SeekableReadS Common::String controlType(controlTypeBuffer); if (controlType.equalsIgnoreCase("push_toggle")) { + // WORKAROUND for a script bug in ZGI: There is an invalid hotspot + // at scene em1h (bottom of tower), which points to a missing + // script em1n. This is a hotspot at the right of the screen. + // In the original, this hotspot doesn't lead anywhere anyway, + // so instead of moving to a missing scene, we just remove the + // hotspot altogether. The alternative would be to just process + // and ignore invalid scenes, but I don't think it's worth the + // effort. Fixes bug #6780. + if (_engine->getGameId() == GID_GRANDINQUISITOR && key == 5653) + return NULL; return new PushToggleControl(_engine, key, stream); } else if (controlType.equalsIgnoreCase("flat")) { Control::parseFlatControl(_engine); -- cgit v1.2.3 From d75fbe79f064e3ee017764024aac173a7d599583 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 23 Jan 2015 03:04:50 +0200 Subject: ZVISION: Error out when a script file can't be found or be parsed This should be an error, as we've effectively reached a non-existing scene (such as in bug #6780), or we haven't parsed script files of a scene fully, thus unexpected behavior will likely occur --- engines/zvision/scripting/scr_file_handling.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'engines/zvision/scripting/scr_file_handling.cpp') diff --git a/engines/zvision/scripting/scr_file_handling.cpp b/engines/zvision/scripting/scr_file_handling.cpp index b9cafa77ed..b047c14430 100644 --- a/engines/zvision/scripting/scr_file_handling.cpp +++ b/engines/zvision/scripting/scr_file_handling.cpp @@ -47,15 +47,13 @@ namespace ZVision { void ScriptManager::parseScrFile(const Common::String &fileName, ScriptScope &scope) { Common::File file; if (!_engine->getSearchManager()->openFile(file, fileName)) { - warning("Script file not found: %s", fileName.c_str()); - return; + error("Script file not found: %s", fileName.c_str()); } while (!file.eos()) { Common::String line = file.readLine(); if (file.err()) { - warning("Error parsing scr file: %s", fileName.c_str()); - return; + error("Error parsing scr file: %s", fileName.c_str()); } trimCommentsAndWhiteSpace(&line); -- cgit v1.2.3 From 6c07f918c698ff23a917857434200e51179bc111 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 3 Feb 2015 12:31:30 +0200 Subject: ZVISION: Fix for script bug #6783 (no sound in the ZNem fist puzzle) This is a bug in the original game script of the Zork Nemesis fist puzzle, which we now patch so that the sound checks are correct for the left fist animation --- engines/zvision/scripting/scr_file_handling.cpp | 26 +++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'engines/zvision/scripting/scr_file_handling.cpp') diff --git a/engines/zvision/scripting/scr_file_handling.cpp b/engines/zvision/scripting/scr_file_handling.cpp index b047c14430..a9f3a55021 100644 --- a/engines/zvision/scripting/scr_file_handling.cpp +++ b/engines/zvision/scripting/scr_file_handling.cpp @@ -83,7 +83,7 @@ void ScriptManager::parsePuzzle(Puzzle *puzzle, Common::SeekableReadStream &stre while (!stream.eos() && !line.contains('}')) { if (line.matchString("criteria {", true)) { - parseCriteria(stream, puzzle->criteriaList); + parseCriteria(stream, puzzle->criteriaList, puzzle->key); } else if (line.matchString("results {", true)) { parseResults(stream, puzzle->resultActions); } else if (line.matchString("flags {", true)) { @@ -97,7 +97,7 @@ void ScriptManager::parsePuzzle(Puzzle *puzzle, Common::SeekableReadStream &stre puzzle->addedBySetState = false; } -bool ScriptManager::parseCriteria(Common::SeekableReadStream &stream, Common::List > &criteriaList) const { +bool ScriptManager::parseCriteria(Common::SeekableReadStream &stream, Common::List > &criteriaList, uint32 key) const { // Loop until we find the closing brace Common::String line = stream.readLine(); trimCommentsAndWhiteSpace(&line); @@ -117,6 +117,21 @@ bool ScriptManager::parseCriteria(Common::SeekableReadStream &stream, Common::Li // Create a new List to hold the CriteriaEntries criteriaList.push_back(Common::List()); + // WORKAROUND for a script bug in Zork: Nemesis, room td9e (fist puzzle) + // Since we patch the script that triggers when manipulating the left fist + // (below), we add an additional check for the left fist sound, so that it + // doesn't get killed immediately when the left fist animation starts. + // Together with the workaround below, it fixes bug #6783. + if (_engine->getGameId() == GID_NEMESIS && key == 3594) { + Puzzle::CriteriaEntry entry; + entry.key = 567; + entry.criteriaOperator = Puzzle::NOT_EQUAL_TO; + entry.argumentIsAKey = false; + entry.argument = 1; + + criteriaList.back().push_back(entry); + } + while (!stream.eos() && !line.contains('}')) { Puzzle::CriteriaEntry entry; @@ -128,6 +143,13 @@ bool ScriptManager::parseCriteria(Common::SeekableReadStream &stream, Common::Li token = tokenizer.nextToken(); sscanf(token.c_str(), "[%u]", &(entry.key)); + // WORKAROUND for a script bug in Zork: Nemesis, room td9e (fist puzzle) + // Check for the state of animation 567 (left fist) when manipulating + // the fingers of the left fist (puzzle slots 3582, 3583). + // Together with the workaround above, it fixes bug #6783. + if (_engine->getGameId() == GID_NEMESIS && (key == 3582 || key == 3583) && entry.key == 568) + entry.key = 567; + // Parse the operator out of the second token token = tokenizer.nextToken(); if (token.c_str()[0] == '=') -- cgit v1.2.3 From b45e706012d7131035867fdd1e6f7109db1ae635 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 17 Feb 2015 01:49:59 +0200 Subject: ZVISION: Fix script bug #6803 (tuning fork box state) --- engines/zvision/scripting/scr_file_handling.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'engines/zvision/scripting/scr_file_handling.cpp') diff --git a/engines/zvision/scripting/scr_file_handling.cpp b/engines/zvision/scripting/scr_file_handling.cpp index a9f3a55021..edc1b8622c 100644 --- a/engines/zvision/scripting/scr_file_handling.cpp +++ b/engines/zvision/scripting/scr_file_handling.cpp @@ -86,6 +86,15 @@ void ScriptManager::parsePuzzle(Puzzle *puzzle, Common::SeekableReadStream &stre parseCriteria(stream, puzzle->criteriaList, puzzle->key); } else if (line.matchString("results {", true)) { parseResults(stream, puzzle->resultActions); + + // WORKAROUND for a script bug in Zork Nemesis, room ve5e (tuning + // fork box closeup). If the player leaves the screen while the + // box is open, puzzle 19398 shows the animation where the box + // closes, but the box state (state variable 19397) is not updated. + // We insert the missing assignment for the box state here. + // Fixes bug #6803. + if (_engine->getGameId() == GID_NEMESIS && puzzle->key == 19398) + puzzle->resultActions.push_back(new ActionAssign(_engine, 11, "19397, 0")); } else if (line.matchString("flags {", true)) { setStateFlag(puzzle->key, parseFlags(stream)); } -- cgit v1.2.3