1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-03 15:45:32 +00:00

[Client] Add uninitializeCell() method to CellController

This commit is contained in:
David Cernat 2020-08-11 04:15:12 +02:00
parent c87a383bee
commit 9a83108fe5
2 changed files with 16 additions and 0 deletions

View file

@ -103,6 +103,21 @@ void CellController::initializeCell(const ESM::Cell& cell)
}
}
void CellController::uninitializeCell(const ESM::Cell& cell)
{
std::string mapIndex = cell.getDescription();
// If this key doesn't exist, create it
if (cellsInitialized.count(mapIndex) > 0)
{
mwmp::Cell* mpCell = cellsInitialized.at(mapIndex);
mpCell->uninitializeLocalActors();
mpCell->uninitializeDedicatedActors();
delete cellsInitialized.at(mapIndex);
cellsInitialized.erase(mapIndex);
}
}
void CellController::readPositions(ActorList& actorList)
{
std::string mapIndex = actorList.cell.getDescription();

View file

@ -20,6 +20,7 @@ namespace mwmp
void updateDedicated(float dt);
void initializeCell(const ESM::Cell& cell);
void uninitializeCell(const ESM::Cell& cell);
void readPositions(mwmp::ActorList& actorList);
void readAnimFlags(mwmp::ActorList& actorList);