1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-30 07:15:34 +00:00

Merge branch 'OpenMW_Bug6067_take3' into 'master'

Make Object Paging to ignore moved references.  (Issue #6139)

See merge request OpenMW/openmw!1001
This commit is contained in:
psi29a 2021-07-09 16:05:53 +00:00
commit c94339f248
2 changed files with 18 additions and 2 deletions

View file

@ -423,9 +423,17 @@ namespace MWRender
cell->restore(esm[index], i);
ESM::CellRef ref;
ref.mRefNum.mContentFile = ESM::RefNum::RefNum_NoContentFile;
ESM::MovedCellRef cMRef;
cMRef.mRefNum.mIndex = 0;
bool deleted = false;
while(cell->getNextRef(esm[index], ref, deleted))
while(cell->getNextRef(esm[index], ref, deleted, /*ignoreMoves*/true, &cMRef))
{
if (cMRef.mRefNum.mIndex)
{
cMRef.mRefNum.mIndex = 0;
continue; // ignore refs that are moved
}
if (std::find(cell->mMovedRefs.begin(), cell->mMovedRefs.end(), ref.mRefNum) != cell->mMovedRefs.end()) continue;
Misc::StringUtils::lowerCaseInPlace(ref.mRefID);
int type = store.findStatic(ref.mRefID);

View file

@ -553,12 +553,20 @@ namespace MWWorld
ESM::CellRef ref;
// Get each reference in turn
ESM::MovedCellRef cMRef;
cMRef.mRefNum.mIndex = 0;
bool deleted = false;
while (mCell->getNextRef (esm[index], ref, deleted))
while(mCell->getNextRef(esm[index], ref, deleted, /*ignoreMoves*/true, &cMRef))
{
if (deleted)
continue;
if (cMRef.mRefNum.mIndex)
{
cMRef.mRefNum.mIndex = 0;
continue; // ignore refs that are moved
}
// 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);