mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
[11819] move SetActiveObjectState to WorldObject level
This commit is contained in:
parent
012be82c86
commit
df0715284f
7 changed files with 23 additions and 29 deletions
|
|
@ -1878,4 +1878,19 @@ bool WorldObject::PrintCoordinatesError(float x, float y, float z, char const* d
|
|||
{
|
||||
sLog.outError("%s with invalid %s coordinates: mapid = %uu, x = %f, y = %f, z = %f", GetGuidStr().c_str(), descr, GetMapId(), x, y, z);
|
||||
return false; // always false for continue assert fail
|
||||
}
|
||||
}
|
||||
|
||||
void WorldObject::SetActiveObjectState(bool active)
|
||||
{
|
||||
if (m_isActiveObject == active || (isType(TYPEMASK_PLAYER) && !active)) // player shouldn't became inactive, never
|
||||
return;
|
||||
|
||||
if (IsInWorld())
|
||||
{
|
||||
if (isActiveObject() && !active)
|
||||
GetMap()->RemoveFromActive(this);
|
||||
else if (!isActiveObject() && active)
|
||||
GetMap()->AddToActive(this);
|
||||
}
|
||||
m_isActiveObject = active;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue