mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 09:35:28 +00:00
seperate permanent and non permanent exterior cells.
This commit is contained in:
parent
f731c5eadb
commit
1fdecaaa34
@ -1116,25 +1116,29 @@ namespace MWWorld
|
||||
ESM4::Cell* Store<ESM4::Cell>::insert(const ESM4::Cell& item, bool overrideOnly)
|
||||
{
|
||||
auto cellPtr = TypedDynamicStore<ESM4::Cell>::insert(item, overrideOnly);
|
||||
if (!cellPtr->mEditorId.empty())
|
||||
mCellNameIndex[cellPtr->mEditorId] = cellPtr;
|
||||
if (cellPtr->isExterior())
|
||||
{
|
||||
mExteriors[{ cellPtr->mX, cellPtr->mY, cellPtr->mParent }] = cellPtr;
|
||||
}
|
||||
|
||||
insertCell(cellPtr);
|
||||
return cellPtr;
|
||||
}
|
||||
|
||||
ESM4::Cell* Store<ESM4::Cell>::insertStatic(const ESM4::Cell& item)
|
||||
{
|
||||
auto cellPtr = TypedDynamicStore<ESM4::Cell>::insertStatic(item);
|
||||
insertCell(cellPtr);
|
||||
return cellPtr;
|
||||
}
|
||||
|
||||
void Store<ESM4::Cell>::insertCell(ESM4::Cell* cellPtr)
|
||||
{
|
||||
if (!cellPtr->mEditorId.empty())
|
||||
mCellNameIndex[cellPtr->mEditorId] = cellPtr;
|
||||
if (cellPtr->isExterior())
|
||||
mExteriors[{ cellPtr->mX, cellPtr->mY, cellPtr->mParent }] = cellPtr;
|
||||
|
||||
return cellPtr;
|
||||
{
|
||||
ESM::ExteriorCellIndex 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()
|
||||
|
@ -286,12 +286,14 @@ namespace MWWorld
|
||||
mCellNameIndex;
|
||||
|
||||
std::unordered_map<ESM::ExteriorCellIndex, ESM4::Cell*> mExteriors;
|
||||
std::unordered_map<ESM::ExteriorCellIndex, ESM4::Cell*> mPersistentExteriors;
|
||||
|
||||
public:
|
||||
const ESM4::Cell* searchCellName(std::string_view) const;
|
||||
const ESM4::Cell* searchExterior(ESM::ExteriorCellIndex cellIndex) const;
|
||||
ESM4::Cell* insert(const ESM4::Cell& item, bool overrideOnly = false);
|
||||
ESM4::Cell* insertStatic(const ESM4::Cell& item);
|
||||
void insertCell(ESM4::Cell* cell);
|
||||
void clearDynamic() override;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user