mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-08 05:11:09 +00:00
feat(Core/Maps): Improve map object updater (#22392)
This commit is contained in:
@@ -1188,6 +1188,7 @@ void WorldObject::AddToWorld()
|
||||
{
|
||||
Object::AddToWorld();
|
||||
GetMap()->GetZoneAndAreaId(GetPhaseMask(), _zoneId, _areaId, GetPositionX(), GetPositionY(), GetPositionZ());
|
||||
GetMap()->AddObjectToPendingUpdateList(this);
|
||||
}
|
||||
|
||||
void WorldObject::RemoveFromWorld()
|
||||
@@ -3220,3 +3221,27 @@ void WorldObject::RemoveAllowedLooter(ObjectGuid guid)
|
||||
{
|
||||
_allowedLooters.erase(guid);
|
||||
}
|
||||
|
||||
bool WorldObject::IsUpdateNeeded()
|
||||
{
|
||||
if (isActiveObject())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool WorldObject::CanBeAddedToMapUpdateList()
|
||||
{
|
||||
switch (GetTypeId())
|
||||
{
|
||||
case TYPEID_UNIT:
|
||||
return IsCreature();
|
||||
case TYPEID_DYNAMICOBJECT:
|
||||
case TYPEID_GAMEOBJECT:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user