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.
This commit is contained in:
Filippos Karapetis 2015-01-20 02:16:21 +02:00
parent 5f9858844a
commit 750d72812b

View File

@ -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;