Some cleanup of CanSeeOrDetect code.
This commit is contained in:
1 parent
dc2bdb8e13
commit
5912e2444d
10 files changed
+25
-42
No files matched your search
@@ -1587,14 +1587,6 @@ bool Position::IsPositionValid() const
|
||||
return Trinity::IsValidMapCoord(m_positionX, m_positionY, m_positionZ, m_orientation);
|
||||
}
|
||||
|
||||
bool WorldObject::isValid() const
|
||||
{
|
||||
if (!IsInWorld())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
float WorldObject::GetGridActivationRange() const
|
||||
{
|
||||
if (ToPlayer())
|
||||
@@ -1638,7 +1630,7 @@ bool WorldObject::canSeeOrDetect(WorldObject const* obj, bool ignoreStealth, boo
|
||||
if (this == obj)
|
||||
return true;
|
||||
|
||||
if (!obj->isValid())
|
||||
if (obj->IsNeverVisible())
|
||||
return false;
|
||||
|
||||
if (GetMap() != obj->GetMap())
|
||||
@@ -1704,7 +1696,7 @@ bool WorldObject::canSeeOrDetect(WorldObject const* obj, bool ignoreStealth, boo
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!obj->isVisibleForInState(this))
|
||||
if (obj->IsInvisibleDueToDespawn())
|
||||
return false;
|
||||
|
||||
if (!canDetect(obj, ignoreStealth))
|
||||
|
||||
Reference in new issue
Block a user