diff --git a/apps/openmw/mwrender/groundcover.cpp b/apps/openmw/mwrender/groundcover.cpp index dd64c851f1..947bdad202 100644 --- a/apps/openmw/mwrender/groundcover.cpp +++ b/apps/openmw/mwrender/groundcover.cpp @@ -172,7 +172,7 @@ namespace MWRender osg::Vec3f pos = ref.mPos.asVec3(); osg::Vec3f cellPos = pos / ESM::Land::REAL_SIZE; if ((minBound.x() > std::floor(minBound.x()) && cellPos.x() < minBound.x()) || (minBound.y() > std::floor(minBound.y()) && cellPos.y() < minBound.y()) - || (maxBound.x() < std::ceil(maxBound.x()) && cellPos.x() >= maxBound.x()) || (minBound.y() < std::ceil(maxBound.y()) && cellPos.y() >= maxBound.y())) + || (maxBound.x() < std::ceil(maxBound.x()) && cellPos.x() >= maxBound.x()) || (maxBound.y() < std::ceil(maxBound.y()) && cellPos.y() >= maxBound.y())) return false; return true; diff --git a/apps/openmw/mwrender/objectpaging.cpp b/apps/openmw/mwrender/objectpaging.cpp index aae8f2e4f1..db81027d9b 100644 --- a/apps/openmw/mwrender/objectpaging.cpp +++ b/apps/openmw/mwrender/objectpaging.cpp @@ -434,7 +434,6 @@ namespace MWRender continue; if (std::find(cell->mMovedRefs.begin(), cell->mMovedRefs.end(), ref.mRefNum) != cell->mMovedRefs.end()) continue; - if (std::find(cell->mMovedRefsByPos.begin(), cell->mMovedRefsByPos.end(), ref.mRefNum) != cell->mMovedRefsByPos.end()) continue; Misc::StringUtils::lowerCaseInPlace(ref.mRefID); int type = store.findStatic(ref.mRefID); if (!typeFilter(type,size>=2)) continue; @@ -456,15 +455,6 @@ namespace MWRender if (!typeFilter(type,size>=2)) continue; refs[ref.mRefNum] = std::move(ref); } - - for (auto [ref, deleted] : cell->mLeasedRefsByPos) - { - if (deleted) { refs.erase(ref.mRefNum); continue; } - Misc::StringUtils::lowerCaseInPlace(ref.mRefID); - int type = store.findStatic(ref.mRefID); - if (!typeFilter(type, size >= 2)) continue; - refs[ref.mRefNum] = std::move(ref); - } } } @@ -507,7 +497,7 @@ namespace MWRender { osg::Vec3f cellPos = pos / ESM::Land::REAL_SIZE; if ((minBound.x() > std::floor(minBound.x()) && cellPos.x() < minBound.x()) || (minBound.y() > std::floor(minBound.y()) && cellPos.y() < minBound.y()) - || (maxBound.x() < std::ceil(maxBound.x()) && cellPos.x() >= maxBound.x()) || (minBound.y() < std::ceil(maxBound.y()) && cellPos.y() >= maxBound.y())) + || (maxBound.x() < std::ceil(maxBound.x()) && cellPos.x() >= maxBound.x()) || (maxBound.y() < std::ceil(maxBound.y()) && cellPos.y() >= maxBound.y())) continue; } diff --git a/apps/openmw/mwworld/store.cpp b/apps/openmw/mwworld/store.cpp index add8b541e0..125239e9a3 100644 --- a/apps/openmw/mwworld/store.cpp +++ b/apps/openmw/mwworld/store.cpp @@ -478,15 +478,6 @@ namespace MWWorld // implementation when the oher implementation works as well. while (cell->getNextRef(esm, ref, deleted, cMRef, moved)) { - - auto x = static_cast<int>(std::floor(ref.mPos.pos[0] / float(ESM::Land::REAL_SIZE))); - auto y = static_cast<int>(std::floor(ref.mPos.pos[1] / float(ESM::Land::REAL_SIZE))); - if (x != cell->getGridX() || y != cell->getGridY()) - { - ESM::Cell* cellAlt = const_cast<ESM::Cell*>(searchOrCreate(x, y)); - cellAlt->mLeasedRefsByPos.emplace_back(ref, deleted); - cell->mMovedRefsByPos.push_back(ref.mRefNum); - } if (!moved) continue; @@ -687,9 +678,6 @@ namespace MWWorld oldcell->mMovedRefs.push_back(*it); } - oldcell->mLeasedRefsByPos.splice(oldcell->mLeasedRefsByPos.end(), cell.mLeasedRefsByPos); - oldcell->mMovedRefsByPos.splice(oldcell->mMovedRefsByPos.end(), cell.mMovedRefsByPos); - // We don't need to merge mLeasedRefs of cell / oldcell. This list is filled when another cell moves a // reference to this cell, so the list for the new cell should be empty. The list for oldcell, // however, could have leased refs in it and so should be kept. diff --git a/components/esm/loadcell.hpp b/components/esm/loadcell.hpp index 23f3d38cc8..18e929e13b 100644 --- a/components/esm/loadcell.hpp +++ b/components/esm/loadcell.hpp @@ -124,11 +124,6 @@ struct Cell CellRefTracker mLeasedRefs; MovedCellRefTracker mMovedRefs; - // References "adopted" from another cell (i.e. a different cell - // introduced this ref, and it has been moved here as it geographically in this cell) - CellRefTracker mLeasedRefsByPos; - std::list<RefNum> mMovedRefsByPos; - void postLoad(ESMReader &esm); // This method is left in for compatibility with esmtool. Parsing moved references currently requires