aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2015-01-20 02:16:21 +0200
committerFilippos Karapetis2015-01-20 02:16:21 +0200
commit750d72812b36bfed3043080d633798854dc4008d (patch)
tree81d1100a54ed2f5a78c94dcea652b5c3c582327a /engines
parent5f9858844a24b00e75ef2c504b2d68c189261dd2 (diff)
downloadscummvm-rg350-750d72812b36bfed3043080d633798854dc4008d.tar.gz
scummvm-rg350-750d72812b36bfed3043080d633798854dc4008d.tar.bz2
scummvm-rg350-750d72812b36bfed3043080d633798854dc4008d.zip
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.
Diffstat (limited to 'engines')
-rw-r--r--engines/zvision/scripting/scr_file_handling.cpp7
1 files changed, 7 insertions, 0 deletions
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;