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:
parent
fbc23a3b57
commit
6d10906832
1 changed files with 8 additions and 1 deletions
|
@ -29,7 +29,11 @@ void ActorFunctions::ReadCellActorList(const char* cellDescription) noexcept
|
|||
{
|
||||
ESM::Cell esmCell = Utils::getCellFromDescription(cellDescription);
|
||||
Cell *serverCell = CellController::get()->getCell(&esmCell);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue