ZVISION: Directly access _globalState instead of using setStateValue

setStateValue does a _referenceTable lookup and potentially adds Puzzles
to _puzzlesToCheck. We know that _referenceTable and _puzzlesToCheck
with be cleared during ScriptManager::changeLocation(), so using
setStateValues ends up just being wasteful.
This commit is contained in:
RichieSams 2013-09-21 00:08:36 -05:00
parent 51fc627c05
commit 8f7fa517d6

View file

@ -399,7 +399,8 @@ void ScriptManager::deserializeStateTable(Common::SeekableReadStream *stream) {
for (uint32 i = 0; i < numberOfPairs; i++) {
uint32 key = stream->readUint32LE();
uint32 value = stream->readUint32LE();
setStateValue(key, value);
// Directly access the state table so we don't trigger Puzzle checks
_globalState[key] = value;
}
}