diff options
-rw-r--r-- | engines/zvision/script_manager.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/engines/zvision/script_manager.cpp b/engines/zvision/script_manager.cpp index 515fd7a450..7531182e95 100644 --- a/engines/zvision/script_manager.cpp +++ b/engines/zvision/script_manager.cpp @@ -245,13 +245,12 @@ void ScriptManager::queuePuzzles(uint32 key) { } 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)); - } - } + if (value == 0) + _globalState.erase(key); + else + _globalState[key] = value; + debug("setStateValue %d %d\n", key , value); + queuePuzzles(key); } void ScriptManager::addToStateValue(uint32 key, uint valueToAdd) { |