aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision
diff options
context:
space:
mode:
authorrichiesams2013-08-10 17:36:57 -0500
committerrichiesams2013-08-10 17:36:57 -0500
commit309034c153568372f49d3b5c5c13537e53e2cdeb (patch)
tree462e50754bb234d42066c9dfc8154fb2a75b2f85 /engines/zvision
parent327d4a1ccff41af28b010679a29168b7e839de29 (diff)
downloadscummvm-rg350-309034c153568372f49d3b5c5c13537e53e2cdeb.tar.gz
scummvm-rg350-309034c153568372f49d3b5c5c13537e53e2cdeb.tar.bz2
scummvm-rg350-309034c153568372f49d3b5c5c13537e53e2cdeb.zip
ZVISION: Stop checking puzzles if ResultAction::execute() returns false
Diffstat (limited to 'engines/zvision')
-rw-r--r--engines/zvision/script_manager.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/engines/zvision/script_manager.cpp b/engines/zvision/script_manager.cpp
index 586cc2af38..3a574a3668 100644
--- a/engines/zvision/script_manager.cpp
+++ b/engines/zvision/script_manager.cpp
@@ -142,17 +142,21 @@ void ScriptManager::checkPuzzleCriteria() {
}
}
- // TODO: Add logic for the different Flags (aka, ONCE_PER_INST)
// criteriaList can be empty. Aka, the puzzle should be executed immediately
if (puzzle->criteriaList.empty() || criteriaMet) {
debug("Puzzle %u criteria passed. Executing its ResultActions", puzzle->key);
+ bool shouldContinue = true;
for (Common::List<Common::SharedPtr<ResultAction> >::iterator resultIter = puzzle->resultActions.begin(); resultIter != puzzle->resultActions.end(); resultIter++) {
- (*resultIter)->execute(_engine);
+ shouldContinue = shouldContinue && (*resultIter)->execute(_engine);
}
// Set the puzzle as completed
setStateValue(puzzle->key, 1);
+
+ if (!shouldContinue) {
+ break;
+ }
}
}
}