feat(Core): port aggro distance from vMaNGOS (#6214)

Read detection_range values from creature_template
This commit is contained in:
Shiroe 2021-07-08 18:01:27 +02:00 committed by GitHub
parent 6fa2ad4e33
commit f8c8e98a0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 89 additions and 72 deletions

View file

@ -1069,9 +1069,9 @@ float WorldObject::GetDistanceZ(const WorldObject* obj) const
return (dist > 0 ? dist : 0);
}
bool WorldObject::_IsWithinDist(WorldObject const* obj, float dist2compare, bool is3D) const
bool WorldObject::_IsWithinDist(WorldObject const* obj, float dist2compare, bool is3D, bool useBoundingRadius) const
{
float sizefactor = GetObjectSize() + obj->GetObjectSize();
float sizefactor = useBoundingRadius ? GetObjectSize() + obj->GetObjectSize() : 0.0f;
float maxdist = dist2compare + sizefactor;
if (m_transport && obj->GetTransport() && obj->GetTransport()->GetGUID() == m_transport->GetGUID())