aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision
diff options
context:
space:
mode:
authorrichiesams2013-08-17 20:38:06 -0500
committerrichiesams2013-08-18 19:52:59 -0500
commitc840d082ceee068446176024b86031f24ed0a968 (patch)
treed78d7c5b7e409ded28cf5306fdb80bb3ae9d8563 /engines/zvision
parenteafd6608cf1e54bb3551671e6fd4a8c6626d44d9 (diff)
downloadscummvm-rg350-c840d082ceee068446176024b86031f24ed0a968.tar.gz
scummvm-rg350-c840d082ceee068446176024b86031f24ed0a968.tar.bz2
scummvm-rg350-c840d082ceee068446176024b86031f24ed0a968.zip
ZVISION: Allow ONCE_PER_INST puzzles to be repeated once per room instead of once per game
Diffstat (limited to 'engines/zvision')
-rw-r--r--engines/zvision/script_manager.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/engines/zvision/script_manager.cpp b/engines/zvision/script_manager.cpp
index 3ca9f01adc..8a1d1c98ed 100644
--- a/engines/zvision/script_manager.cpp
+++ b/engines/zvision/script_manager.cpp
@@ -108,11 +108,9 @@ void ScriptManager::checkPuzzleCriteria() {
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::ONCE_PER_INST) == Puzzle::ONCE_PER_INST &&
- (puzzle->flags & Puzzle::DISABLED) == 0) {
+ (puzzle->flags & Puzzle::DISABLED) == 0) {
continue;
}
@@ -226,18 +224,28 @@ void ScriptManager::changeLocationIntern() {
// Change the background position
_engine->getRenderManager()->setBackgroundPosition(_nextLocation.offset);
- // Create the puzzle reference table
- createReferenceTable();
-
// Add all the local puzzles to the stack to be checked
for (Common::List<Puzzle>::iterator iter = _activePuzzles.begin(); iter != _activePuzzles.end(); iter++) {
+ // Reset any Puzzles that have the flag ONCE_PER_INST
+ if ((*iter).flags & Puzzle::ONCE_PER_INST == Puzzle::ONCE_PER_INST) {
+ setStateValue((*iter).key, 0);
+ }
+
_puzzlesToCheck.push(&(*iter));
}
// Add all the global puzzles to the stack to be checked
for (Common::List<Puzzle>::iterator iter = _globalPuzzles.begin(); iter != _globalPuzzles.end(); iter++) {
+ // Reset any Puzzles that have the flag ONCE_PER_INST
+ if ((*iter).flags & Puzzle::ONCE_PER_INST == Puzzle::ONCE_PER_INST) {
+ setStateValue((*iter).key, 0);
+ }
+
_puzzlesToCheck.push(&(*iter));
}
+
+ // Create the puzzle reference table
+ createReferenceTable();
}
} // End of namespace ZVision