aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision
diff options
context:
space:
mode:
authorMarisa-Chan2013-11-15 18:05:11 +0000
committerMarisa-Chan2013-11-15 18:05:11 +0000
commit9363a0d07115368f8964dfca5f48730552ef9855 (patch)
treeed7c39e878bbe27507ee66ba86d018ed7063b2b5 /engines/zvision
parent29fc5be12ee5e28e1b74402065858698f4b8eb16 (diff)
downloadscummvm-rg350-9363a0d07115368f8964dfca5f48730552ef9855.tar.gz
scummvm-rg350-9363a0d07115368f8964dfca5f48730552ef9855.tar.bz2
scummvm-rg350-9363a0d07115368f8964dfca5f48730552ef9855.zip
ZVISION: Reverse queue puzzles adding to end->begin
Diffstat (limited to 'engines/zvision')
-rw-r--r--engines/zvision/script_manager.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/engines/zvision/script_manager.cpp b/engines/zvision/script_manager.cpp
index 13fb58b022..28850857df 100644
--- a/engines/zvision/script_manager.cpp
+++ b/engines/zvision/script_manager.cpp
@@ -266,10 +266,11 @@ int ScriptManager::getStateValue(uint32 key) {
void ScriptManager::queuePuzzles(uint32 key) {
if (_referenceTable.contains(key)) {
- for (Common::Array<puzzle_ref>::iterator iter = _referenceTable[key].begin(); iter != _referenceTable[key].end(); ++iter)
- if (!iter->puz->addedBySetState) {
- iter->scope->scope_queue->push_back(iter->puz);
- iter->puz->addedBySetState = true;
+ Common::Array<puzzle_ref> *arr = &_referenceTable[key];
+ for (int32 i = arr->size() - 1; i >= 0; i--)
+ if (!(*arr)[i].puz->addedBySetState) {
+ (*arr)[i].scope->scope_queue->push_back((*arr)[i].puz);
+ (*arr)[i].puz->addedBySetState = true;
}
}
}