aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
+ }
}
}
}