From 7afd2ca6141246a55225d83a8ee13979dc826d28 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 14 Jun 2014 19:13:40 +0200 Subject: [PATCH] Consider moved references in CellStore::listRefs --- apps/openmw/mwworld/cellstore.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/apps/openmw/mwworld/cellstore.cpp b/apps/openmw/mwworld/cellstore.cpp index 3e29a9cae..ce8d77758 100644 --- a/apps/openmw/mwworld/cellstore.cpp +++ b/apps/openmw/mwworld/cellstore.cpp @@ -450,10 +450,25 @@ namespace MWWorld if (deleted) continue; + // Don't list reference if it was moved to a different cell. + ESM::MovedCellRefTracker::const_iterator iter = + std::find(mCell->mMovedRefs.begin(), mCell->mMovedRefs.end(), ref.mRefNum); + if (iter != mCell->mMovedRefs.end()) { + continue; + } + mIds.push_back (Misc::StringUtils::lowerCase (ref.mRefID)); } } + // List moved references, from separately tracked list. + for (ESM::CellRefTracker::const_iterator it = mCell->mLeasedRefs.begin(); it != mCell->mLeasedRefs.end(); ++it) + { + ESM::CellRef &ref = const_cast(*it); + + mIds.push_back(Misc::StringUtils::lowerCase(ref.mRefID)); + } + std::sort (mIds.begin(), mIds.end()); }