mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-06-25 18:41:35 +00:00
Cell merge fix (reference context position was not saved correctly)
This commit is contained in:
parent
41ab7329a8
commit
68d6b6b2f3
1 changed files with 8 additions and 3 deletions
|
@ -70,13 +70,15 @@ void Store<ESM::Cell>::load(ESM::ESMReader &esm, const std::string &id)
|
||||||
ESM::Cell *oldcell = const_cast<ESM::Cell*>(search(cell.getGridX(), cell.getGridY()));
|
ESM::Cell *oldcell = const_cast<ESM::Cell*>(search(cell.getGridX(), cell.getGridY()));
|
||||||
if (oldcell) {
|
if (oldcell) {
|
||||||
// merge new cell into old cell
|
// merge new cell into old cell
|
||||||
// push the new references on the list of references to manage (saveContext = true)
|
|
||||||
oldcell->mData = cell.mData;
|
oldcell->mData = cell.mData;
|
||||||
oldcell->loadCell(esm, true);
|
oldcell->loadCell(esm, false);
|
||||||
|
|
||||||
// handle moved ref (MVRF) subrecords
|
// handle moved ref (MVRF) subrecords
|
||||||
handleMovedCellRefs (esm, &cell);
|
handleMovedCellRefs (esm, &cell);
|
||||||
|
|
||||||
|
// push the new references on the list of references to manage
|
||||||
|
oldcell->postLoad(esm);
|
||||||
|
|
||||||
// merge lists of leased references, use newer data in case of conflict
|
// merge lists of leased references, use newer data in case of conflict
|
||||||
for (ESM::MovedCellRefTracker::const_iterator it = cell.mMovedRefs.begin(); it != cell.mMovedRefs.end(); ++it) {
|
for (ESM::MovedCellRefTracker::const_iterator it = cell.mMovedRefs.begin(); it != cell.mMovedRefs.end(); ++it) {
|
||||||
// remove reference from current leased ref tracker and add it to new cell
|
// remove reference from current leased ref tracker and add it to new cell
|
||||||
|
@ -96,11 +98,14 @@ void Store<ESM::Cell>::load(ESM::ESMReader &esm, const std::string &id)
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
// spawn a new cell
|
// spawn a new cell
|
||||||
cell.loadCell(esm, true);
|
cell.loadCell(esm, false);
|
||||||
|
|
||||||
// handle moved ref (MVRF) subrecords
|
// handle moved ref (MVRF) subrecords
|
||||||
handleMovedCellRefs (esm, &cell);
|
handleMovedCellRefs (esm, &cell);
|
||||||
|
|
||||||
|
// push the new references on the list of references to manage
|
||||||
|
cell.postLoad(esm);
|
||||||
|
|
||||||
mExt[std::make_pair(cell.mData.mX, cell.mData.mY)] = cell;
|
mExt[std::make_pair(cell.mData.mX, cell.mData.mY)] = cell;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue