diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-01-21 15:46:06 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-01-21 17:11:51 +0300 |
commit | e91f132e740a71eca0a75e3de1bd358e1e58ab01 (patch) | |
tree | cfd283f1034917215513f8574bda35ca654ee533 /src | |
parent | 2744e4fa8f39cd06bfe557a5a3881830bd11501c (diff) | |
download | plus-e91f132e740a71eca0a75e3de1bd358e1e58ab01.tar.gz plus-e91f132e740a71eca0a75e3de1bd358e1e58ab01.tar.bz2 plus-e91f132e740a71eca0a75e3de1bd358e1e58ab01.tar.xz plus-e91f132e740a71eca0a75e3de1bd358e1e58ab01.zip |
Fix sounds if quest variables working in loop.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/questswindow.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/questswindow.cpp b/src/gui/questswindow.cpp index 911394a56..a17e86323 100644 --- a/src/gui/questswindow.cpp +++ b/src/gui/questswindow.cpp @@ -268,6 +268,7 @@ void QuestsWindow::rebuild(const bool playSound) std::vector<Image*> &images = mQuestsModel->getImages(); std::vector<QuestItem*> complete; std::vector<QuestItem*> incomplete; + std::vector<QuestItem*> hidden; int updatedQuest = -1; int newCompleteStatus = -1; @@ -288,6 +289,9 @@ void QuestsWindow::rebuild(const bool playSound) // incomplete quest else if (quest->incomplete.find(val) != quest->incomplete.end()) incomplete.push_back(quest); + // hidden quest + else + hidden.push_back(quest); } } @@ -339,6 +343,12 @@ void QuestsWindow::rebuild(const bool playSound) } } + FOR_EACH (std::vector<QuestItem*>::const_iterator, it, hidden) + { + QuestItem *const quest = *it; + quest->completeFlag = -1; + } + if (updatedQuest == -1) updatedQuest = static_cast<int>(mQuestLinks.size() - 1); else if (updatedQuest >= static_cast<int>(mQuestLinks.size())) |