mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-28 07:32:00 -04:00
[Server] Fix crashes related to reading actor lists in unloaded cells
This commit is contained in:
parent
fbc23a3b57
commit
6d10906832
@ -29,7 +29,11 @@ void ActorFunctions::ReadCellActorList(const char* cellDescription) noexcept
|
|||||||
{
|
{
|
||||||
ESM::Cell esmCell = Utils::getCellFromDescription(cellDescription);
|
ESM::Cell esmCell = Utils::getCellFromDescription(cellDescription);
|
||||||
Cell *serverCell = CellController::get()->getCell(&esmCell);
|
Cell *serverCell = CellController::get()->getCell(&esmCell);
|
||||||
|
|
||||||
|
if (serverCell != nullptr)
|
||||||
readActorList = serverCell->getActorList();
|
readActorList = serverCell->getActorList();
|
||||||
|
else
|
||||||
|
readActorList = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActorFunctions::ClearActorList() noexcept
|
void ActorFunctions::ClearActorList() noexcept
|
||||||
@ -53,6 +57,9 @@ void ActorFunctions::CopyReceivedActorListToStore() noexcept
|
|||||||
|
|
||||||
unsigned int ActorFunctions::GetActorListSize() noexcept
|
unsigned int ActorFunctions::GetActorListSize() noexcept
|
||||||
{
|
{
|
||||||
|
if (readActorList == nullptr)
|
||||||
|
return 0;
|
||||||
|
|
||||||
return readActorList->count;
|
return readActorList->count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user