From 083bcaf483534c43830d995b11c2128573a7b1a2 Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 2 Oct 2014 19:26:37 +0200 Subject: [PATCH] Fix journal quest logs not being marked finished when there are multiple quest IDs in the log --- apps/openmw/mwgui/journalviewmodel.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwgui/journalviewmodel.cpp b/apps/openmw/mwgui/journalviewmodel.cpp index 45a1858d2..0ab56200d 100644 --- a/apps/openmw/mwgui/journalviewmodel.cpp +++ b/apps/openmw/mwgui/journalviewmodel.cpp @@ -201,12 +201,23 @@ struct JournalViewModelImpl : JournalViewModel std::set visitedQuests; + // Note that for purposes of the journal GUI, quests are identified by the name, not the ID, so several + // different quest IDs can end up in the same quest log. A quest log should be considered finished + // when any quest ID in that log is finished. for (MWBase::Journal::TQuestIter i = journal->questBegin (); i != journal->questEnd (); ++i) { - if (active_only && i->second.isFinished ()) + const MWDialogue::Quest& quest = i->second; + + bool isFinished = false; + for (MWBase::Journal::TQuestIter j = journal->questBegin (); j != journal->questEnd (); ++j) + { + if (quest.getName() == j->second.getName() && j->second.isFinished()) + isFinished = true; + } + + if (active_only && isFinished) continue; - const MWDialogue::Quest& quest = i->second; // Unfortunately Morrowind.esm has no quest names, since the quest book was added with tribunal. // Note that even with Tribunal, some quests still don't have quest names. I'm assuming those are not supposed // to appear in the quest book.