1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-03-03 19:49:41 +00:00

Handle Deleted moved references (Bug #1613)

This commit is contained in:
scrawl 2014-07-01 21:44:16 +02:00
parent e666ddfe18
commit 6cd6578a88

View file

@ -23,12 +23,15 @@ void Store<ESM::Cell>::handleMovedCellRefs(ESM::ESMReader& esm, ESM::Cell* cell)
// We should not need to test for duplicates, as this part of the code is pre-cell merge. // We should not need to test for duplicates, as this part of the code is pre-cell merge.
cell->mMovedRefs.push_back(cMRef); cell->mMovedRefs.push_back(cMRef);
// But there may be duplicates here! // But there may be duplicates here!
if (!deleted)
{
ESM::CellRefTracker::iterator iter = std::find(cellAlt->mLeasedRefs.begin(), cellAlt->mLeasedRefs.end(), ref.mRefNum); ESM::CellRefTracker::iterator iter = std::find(cellAlt->mLeasedRefs.begin(), cellAlt->mLeasedRefs.end(), ref.mRefNum);
if (iter == cellAlt->mLeasedRefs.end()) if (iter == cellAlt->mLeasedRefs.end())
cellAlt->mLeasedRefs.push_back(ref); cellAlt->mLeasedRefs.push_back(ref);
else else
*iter = ref; *iter = ref;
} }
}
} }
void Store<ESM::Cell>::load(ESM::ESMReader &esm, const std::string &id) void Store<ESM::Cell>::load(ESM::ESMReader &esm, const std::string &id)