1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-03-04 21:49:40 +00:00

[Server] Fix crashes related to reading actor lists in unloaded cells

This commit is contained in:
David Cernat 2020-06-23 01:05:39 +03:00
parent fbc23a3b57
commit 6d10906832

View file

@ -29,7 +29,11 @@ void ActorFunctions::ReadCellActorList(const char* cellDescription) noexcept
{
ESM::Cell esmCell = Utils::getCellFromDescription(cellDescription);
Cell *serverCell = CellController::get()->getCell(&esmCell);
readActorList = serverCell->getActorList();
if (serverCell != nullptr)
readActorList = serverCell->getActorList();
else
readActorList = {};
}
void ActorFunctions::ClearActorList() noexcept
@ -53,6 +57,9 @@ void ActorFunctions::CopyReceivedActorListToStore() noexcept
unsigned int ActorFunctions::GetActorListSize() noexcept
{
if (readActorList == nullptr)
return 0;
return readActorList->count;
}