1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 17:29:55 +00:00

Remove mPersistentExteriors index; fix incorrect Rec_Persistent flag check.

This commit is contained in:
Petr Mikheev 2023-05-29 22:16:56 +02:00
parent 8976a1594f
commit 01c410d6b1
2 changed files with 6 additions and 9 deletions

View file

@ -1212,16 +1212,15 @@ namespace MWWorld
void Store<ESM4::Cell>::insertCell(ESM4::Cell* cellPtr) void Store<ESM4::Cell>::insertCell(ESM4::Cell* cellPtr)
{ {
// Do not index exterior cells with Rec_Persistent flag because they are not real cells.
// References from these cells are merged into normal cells.
if (cellPtr->isExterior() && cellPtr->mFlags & ESM4::Rec_Persistent)
return;
if (!cellPtr->mEditorId.empty()) if (!cellPtr->mEditorId.empty())
mCellNameIndex[cellPtr->mEditorId] = cellPtr; mCellNameIndex[cellPtr->mEditorId] = cellPtr;
if (cellPtr->isExterior()) if (cellPtr->isExterior())
{ mExteriors[ESM::ExteriorCellLocation(cellPtr->mX, cellPtr->mY, cellPtr->mParent)] = cellPtr;
ESM::ExteriorCellLocation cellindex = { cellPtr->mX, cellPtr->mY, cellPtr->mParent };
if (cellPtr->mCellFlags & ESM4::Rec_Persistent)
mPersistentExteriors[cellindex] = cellPtr;
else
mExteriors[cellindex] = cellPtr;
}
} }
void Store<ESM4::Cell>::clearDynamic() void Store<ESM4::Cell>::clearDynamic()

View file

@ -291,9 +291,7 @@ namespace MWWorld
{ {
std::unordered_map<std::string, ESM4::Cell*, Misc::StringUtils::CiHash, Misc::StringUtils::CiEqual> std::unordered_map<std::string, ESM4::Cell*, Misc::StringUtils::CiHash, Misc::StringUtils::CiEqual>
mCellNameIndex; mCellNameIndex;
std::unordered_map<ESM::ExteriorCellLocation, ESM4::Cell*> mExteriors; std::unordered_map<ESM::ExteriorCellLocation, ESM4::Cell*> mExteriors;
std::unordered_map<ESM::ExteriorCellLocation, ESM4::Cell*> mPersistentExteriors;
public: public:
const ESM4::Cell* searchCellName(std::string_view) const; const ESM4::Cell* searchCellName(std::string_view) const;