From 9574d8da754870021b15018f5de07fa2531d6be5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 21 Jan 2013 17:17:49 +0300 Subject: Play sounds also in broken quests (where missing complete or incomplete part) --- src/gui/questswindow.cpp | 11 +++++++++-- 1 file 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 complete; std::vector 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; -- cgit v1.2.3-70-g09d2