From 750d72812b36bfed3043080d633798854dc4008d Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 20 Jan 2015 02:16:21 +0200 Subject: [PATCH] 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(+) diff --git a/engines/zvision/scripting/scr_file_handling.cpp b/engines/zvision/scripting/scr_file_handling.cpp index b4da61a119b..277702d2876 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;