mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-05 18:19:41 +00:00
[Client] Uninitialize LocalActors whose references have been deleted
This commit is contained in:
parent
f219cb5417
commit
3e881e6231
1 changed files with 18 additions and 4 deletions
|
@ -79,10 +79,24 @@ void Cell::updateLocal(bool forceUpdate)
|
|||
}
|
||||
else
|
||||
{
|
||||
// Forcibly update this local actor if its data has never been sent before;
|
||||
// otherwise, use the current forceUpdate value
|
||||
if (actor->getPtr().getRefData().isEnabled() && !actor->getPtr().getRefData().isDeleted())
|
||||
actor->update(actor->hasSentData ? forceUpdate : true);
|
||||
if (actor->getPtr().getRefData().isEnabled())
|
||||
{
|
||||
if (actor->getPtr().getRefData().isDeleted())
|
||||
{
|
||||
std::string mapIndex = it->first;
|
||||
LOG_APPEND(TimedLog::LOG_VERBOSE, "- Deleting LocalActor %s whose reference has been deleted",
|
||||
mapIndex.c_str(), getShortDescription().c_str());
|
||||
cellController->removeLocalActorRecord(mapIndex);
|
||||
delete actor;
|
||||
localActors.erase(it++);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Forcibly update this local actor if its data has never been sent before;
|
||||
// otherwise, use the current forceUpdate value
|
||||
actor->update(actor->hasSentData ? forceUpdate : true);
|
||||
}
|
||||
}
|
||||
|
||||
++it;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue