From 9363a0d07115368f8964dfca5f48730552ef9855 Mon Sep 17 00:00:00 2001 From: Marisa-Chan Date: Fri, 15 Nov 2013 18:05:11 +0000 Subject: ZVISION: Reverse queue puzzles adding to end->begin --- engines/zvision/script_manager.cpp | 9 +++++---- 1 file 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::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 *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; } } } -- cgit v1.2.3