From 309034c153568372f49d3b5c5c13537e53e2cdeb Mon Sep 17 00:00:00 2001 From: richiesams Date: Sat, 10 Aug 2013 17:36:57 -0500 Subject: ZVISION: Stop checking puzzles if ResultAction::execute() returns false --- engines/zvision/script_manager.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'engines') 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 >::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; + } } } } -- cgit v1.2.3