From e91f132e740a71eca0a75e3de1bd358e1e58ab01 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 21 Jan 2013 15:46:06 +0300 Subject: Fix sounds if quest variables working in loop. --- src/gui/questswindow.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/gui') 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 &images = mQuestsModel->getImages(); std::vector complete; std::vector incomplete; + std::vector 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::const_iterator, it, hidden) + { + QuestItem *const quest = *it; + quest->completeFlag = -1; + } + if (updatedQuest == -1) updatedQuest = static_cast(mQuestLinks.size() - 1); else if (updatedQuest >= static_cast(mQuestLinks.size())) -- cgit v1.2.3-70-g09d2