aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorrichiesams2013-08-05 19:18:04 -0500
committerrichiesams2013-08-05 19:19:34 -0500
commit931ad00a2d208335fc45885bfc7f53a53e6d9dce (patch)
tree2ff1ad17db5e18464fa60c8798f7a05cffcbaa88 /engines
parent387bfb2806856dcf76cb12a7a3b571aa62a59298 (diff)
downloadscummvm-rg350-931ad00a2d208335fc45885bfc7f53a53e6d9dce.tar.gz
scummvm-rg350-931ad00a2d208335fc45885bfc7f53a53e6d9dce.tar.bz2
scummvm-rg350-931ad00a2d208335fc45885bfc7f53a53e6d9dce.zip
ZVISION: Add StateFlag handling to Puzzle checking
Diffstat (limited to 'engines')
-rw-r--r--engines/zvision/script_manager.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/engines/zvision/script_manager.cpp b/engines/zvision/script_manager.cpp
index 38ca1075d1..fe6548cd80 100644
--- a/engines/zvision/script_manager.cpp
+++ b/engines/zvision/script_manager.cpp
@@ -77,6 +77,15 @@ void ScriptManager::checkPuzzleCriteria() {
while (!_puzzlesToCheck.empty()) {
Puzzle *puzzle = _puzzlesToCheck.pop();
+ // Check if the puzzle is already finished
+ // If it doesn't have the flag ONCE_PER_INST it can be done more than once
+ // Also check that the puzzle isn't disabled
+ if (getStateValue(puzzle->key) == 1 &&
+ (puzzle->flags & Puzzle::StateFlags::ONCE_PER_INST) == Puzzle::StateFlags::ONCE_PER_INST &&
+ (puzzle->flags & Puzzle::StateFlags::DISABLED) == 0) {
+ continue;
+ }
+
debug("Checking puzzle: %u", puzzle->key);
// Check each Criteria