1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-20 15:40:32 +00:00

Fix CSMWorld::InfoCollection::getTopicRange() returning one too many.

This commit is contained in:
cc9cii 2021-08-01 14:16:37 +10:00
parent 547bc4a252
commit 67cad2c515

View File

@ -2,6 +2,7 @@
#include <stdexcept>
#include <iterator>
#include <cassert>
#include <components/esm/esmreader.hpp>
#include <components/esm/loaddial.hpp>
@ -256,8 +257,8 @@ CSMWorld::InfoCollection::Range CSMWorld::InfoCollection::getTopicRange (const s
// Find end (one past the range)
RecordConstIterator end = begin + iter->second.size();
if (end != getRecords().end())
++end;
assert(static_cast<size_t>(std::distance(begin, end)) == iter->second.size());
return Range (begin, end);
}