From f06ddd47c40f100a9610af3baf8b572d6308bbed Mon Sep 17 00:00:00 2001 From: cc9cii Date: Tue, 26 May 2015 17:38:22 +1000 Subject: [PATCH] Return the correct range for a given topic. Should resolve Bug #2569. --- apps/opencs/model/world/infocollection.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/apps/opencs/model/world/infocollection.cpp b/apps/opencs/model/world/infocollection.cpp index f2d81823c..a508d28f3 100644 --- a/apps/opencs/model/world/infocollection.cpp +++ b/apps/opencs/model/world/infocollection.cpp @@ -173,6 +173,17 @@ CSMWorld::InfoCollection::Range CSMWorld::InfoCollection::getTopicRange (const s RecordConstIterator begin = getRecords().begin()+iter->second; + while (begin != getRecords().begin()) + { + if (!Misc::StringUtils::ciEqual(begin->get().mTopicId, topic2)) + { + // we've gone one too far, go back + ++begin; + break; + } + --begin; + } + // Find end RecordConstIterator end = begin;