From eeace477a08d68ead85d39b90084b4e633a6127a Mon Sep 17 00:00:00 2001 From: RichieSams Date: Sat, 7 Sep 2013 18:06:20 -0500 Subject: [PATCH] ZVISION: Set a Puzzle as completed before executing its ResultActions --- engines/zvision/script_manager.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/engines/zvision/script_manager.cpp b/engines/zvision/script_manager.cpp index f499adaa44c..4952ebdda4b 100644 --- a/engines/zvision/script_manager.cpp +++ b/engines/zvision/script_manager.cpp @@ -174,7 +174,8 @@ void ScriptManager::checkPuzzleCriteria() { if (puzzle->criteriaList.empty() || criteriaMet) { debug("Puzzle %u criteria passed. Executing its ResultActions", puzzle->key); - uint32 key = puzzle->key; + // Set the puzzle as completed + setStateValue(puzzle->key, 1); bool shouldContinue = true; for (Common::List::iterator resultIter = puzzle->resultActions.begin(); resultIter != puzzle->resultActions.end(); resultIter++) { @@ -184,9 +185,6 @@ void ScriptManager::checkPuzzleCriteria() { } } - // Set the puzzle as completed - setStateValue(key, 1); - if (!shouldContinue) { break; }