From 3406d2fa89234cddd542a8ef97ddd1f107664a22 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Tue, 26 Apr 2011 20:22:50 +0200 Subject: [PATCH] removed redundant data from quest class --- apps/openmw/mwdialogue/quest.cpp | 9 +++++++-- apps/openmw/mwdialogue/quest.hpp | 6 ++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwdialogue/quest.cpp b/apps/openmw/mwdialogue/quest.cpp index 13e432762..d47c78c6e 100644 --- a/apps/openmw/mwdialogue/quest.cpp +++ b/apps/openmw/mwdialogue/quest.cpp @@ -78,10 +78,10 @@ namespace MWDialogue setIndex (index, world); for (TEntryIter iter (mEntries.begin()); iter!=mEntries.end(); ++iter) - if (iter->mInfoId==entry.mInfoId) + if (*iter==entry.mInfoId) return; - mEntries.push_back (entry); + mEntries.push_back (entry.mInfoId); } Quest::TEntryIter Quest::begin() @@ -93,4 +93,9 @@ namespace MWDialogue { return mEntries.end(); } + + JournalEntry Quest::getEntry (const std::string& infoId) + { + return JournalEntry (mTopic, infoId); + } } diff --git a/apps/openmw/mwdialogue/quest.hpp b/apps/openmw/mwdialogue/quest.hpp index f484dfaf7..9f173f6d3 100644 --- a/apps/openmw/mwdialogue/quest.hpp +++ b/apps/openmw/mwdialogue/quest.hpp @@ -18,14 +18,14 @@ namespace MWDialogue { public: - typedef std::vector TEntryContainer; + typedef std::vector TEntryContainer; typedef TEntryContainer::const_iterator TEntryIter; private: std::string mTopic; int mIndex; - std::vector mEntries; + TEntryContainer mEntries; // info-IDs bool mFinished; public: @@ -54,6 +54,8 @@ namespace MWDialogue TEntryIter end(); ///< Iterator pointing past the end of the journal for this quest. + + JournalEntry getEntry (const std::string& infoId); }; }