From a988a0d6dcdb6a5ef853a4fb7bf756bee397690c Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 25 Jan 2014 23:07:52 +0100 Subject: [PATCH] Don't add duplicate topic responses to the journal --- apps/openmw/mwdialogue/topic.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/openmw/mwdialogue/topic.cpp b/apps/openmw/mwdialogue/topic.cpp index 0e546f43bc..f7df305c70 100644 --- a/apps/openmw/mwdialogue/topic.cpp +++ b/apps/openmw/mwdialogue/topic.cpp @@ -24,6 +24,13 @@ namespace MWDialogue if (entry.mTopic!=mTopic) throw std::runtime_error ("topic does not match: " + mTopic); + // bail out if we already have heard this + for (Topic::TEntryIter it = mEntries.begin(); it != mEntries.end(); ++it) + { + if (it->mInfoId == entry.mInfoId) + return; + } + mEntries.push_back (entry); // we want slicing here }