diff --git a/apps/openmw/mwworld/store.cpp b/apps/openmw/mwworld/store.cpp index 19b204073..fdeb290e5 100644 --- a/apps/openmw/mwworld/store.cpp +++ b/apps/openmw/mwworld/store.cpp @@ -70,13 +70,15 @@ void Store::load(ESM::ESMReader &esm, const std::string &id) ESM::Cell *oldcell = const_cast(search(cell.getGridX(), cell.getGridY())); if (oldcell) { // merge new cell into old cell - // push the new references on the list of references to manage (saveContext = true) oldcell->mData = cell.mData; - oldcell->loadCell(esm, true); + oldcell->loadCell(esm, false); // handle moved ref (MVRF) subrecords 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 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 @@ -96,11 +98,14 @@ void Store::load(ESM::ESMReader &esm, const std::string &id) } else { // spawn a new cell - cell.loadCell(esm, true); + cell.loadCell(esm, false); // handle moved ref (MVRF) subrecords 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; } }