summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-01-21 15:46:06 +0300
committerAndrei Karas <akaras@inbox.ru>2013-01-21 17:11:51 +0300
commite91f132e740a71eca0a75e3de1bd358e1e58ab01 (patch)
treecfd283f1034917215513f8574bda35ca654ee533 /src
parent2744e4fa8f39cd06bfe557a5a3881830bd11501c (diff)
downloadplus-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.cpp10
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()))