aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrichiesams2013-08-03 14:59:00 -0500
committerrichiesams2013-08-04 13:33:09 -0500
commit11118262e4d884a838ac8ce0f8d674948aac1d33 (patch)
treedf5efb1fe47fb34347c57050aa770f36322d0848
parent9e996c4fec6477395d98ddc670df8732db3d7f28 (diff)
downloadscummvm-rg350-11118262e4d884a838ac8ce0f8d674948aac1d33.tar.gz
scummvm-rg350-11118262e4d884a838ac8ce0f8d674948aac1d33.tar.bz2
scummvm-rg350-11118262e4d884a838ac8ce0f8d674948aac1d33.zip
ZVISION: Add logic to check _referenceTable Puzzles every time a globalState is changed
-rw-r--r--engines/zvision/script_manager.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/engines/zvision/script_manager.cpp b/engines/zvision/script_manager.cpp
index 55cd570467..2e57c18a3e 100644
--- a/engines/zvision/script_manager.cpp
+++ b/engines/zvision/script_manager.cpp
@@ -121,9 +121,14 @@ uint ScriptManager::getStateValue(uint32 key) {
return _globalState[key];
}
-// TODO: Add logic to check _referenceTable and add to _puzzlesToCheck if necessary
void ScriptManager::setStateValue(uint32 key, uint value) {
_globalState[key] = value;
+
+ if (_referenceTable.contains(key)) {
+ for (Common::Array<Puzzle *>::iterator iter = _referenceTable[key].begin(); iter != _referenceTable[key].end(); iter++) {
+ _puzzlesToCheck.push((*iter));
+ }
+ }
}
void ScriptManager::addToStateValue(uint32 key, uint valueToAdd) {