diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-01-21 17:17:49 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-01-21 17:17:49 +0300 |
commit | 9574d8da754870021b15018f5de07fa2531d6be5 (patch) | |
tree | af6072b7af2ec322cb069ac6eb8d1c150a65953e /src | |
parent | e91f132e740a71eca0a75e3de1bd358e1e58ab01 (diff) | |
download | plus-9574d8da754870021b15018f5de07fa2531d6be5.tar.gz plus-9574d8da754870021b15018f5de07fa2531d6be5.tar.bz2 plus-9574d8da754870021b15018f5de07fa2531d6be5.tar.xz plus-9574d8da754870021b15018f5de07fa2531d6be5.zip |
Play sounds also in broken quests (where missing complete or incomplete part)
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/questswindow.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gui/questswindow.cpp b/src/gui/questswindow.cpp index a17e86323..11e93d9e9 100644 --- a/src/gui/questswindow.cpp +++ b/src/gui/questswindow.cpp @@ -64,7 +64,9 @@ struct QuestItemText final struct QuestItem final { QuestItem() : - var(0), completeFlag(-1) + var(0), + completeFlag(-1), + broken(false) { } @@ -75,6 +77,7 @@ struct QuestItem final std::set<int> complete; std::vector<QuestItemText> texts; int completeFlag; + bool broken; }; class QuestsModel final : public ExtendedNamesModel @@ -219,6 +222,9 @@ void QuestsWindow::loadQuest(const int var, const XmlNodePtr node) delete quest; return; } + if (quest->incomplete.empty() || quest->complete.empty()) + quest->broken = true; + for_each_xml_child_node(dataNode, node) { if (!xmlTypeEqual(dataNode, XML_ELEMENT_NODE)) @@ -301,7 +307,8 @@ void QuestsWindow::rebuild(const bool playSound) it_end = complete.end(); it != it_end; ++ it, k ++) { QuestItem *const quest = *it; - if (quest->completeFlag == 0) + if (quest->completeFlag == 0 || (quest->broken + && quest->completeFlag == -1)) { updatedQuest = k; newCompleteStatus = 1; |