mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-23 04:26:31 -04:00
[Client] Uninitialize LocalActors whose references have been deleted
This commit is contained in:
parent
f219cb5417
commit
3e881e6231
@ -79,10 +79,24 @@ void Cell::updateLocal(bool forceUpdate)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Forcibly update this local actor if its data has never been sent before;
|
if (actor->getPtr().getRefData().isEnabled())
|
||||||
// otherwise, use the current forceUpdate value
|
{
|
||||||
if (actor->getPtr().getRefData().isEnabled() && !actor->getPtr().getRefData().isDeleted())
|
if (actor->getPtr().getRefData().isDeleted())
|
||||||
actor->update(actor->hasSentData ? forceUpdate : true);
|
{
|
||||||
|
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;
|
++it;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user