mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 11:25:42 +00:00
feat(Core/Visibility): Far visibility worldobjects (#22828)
This commit is contained in:
@@ -16311,13 +16311,25 @@ float Player::GetSightRange(WorldObject const* target) const
|
||||
{
|
||||
float sightRange = WorldObject::GetSightRange(target);
|
||||
if (_farSightDistance)
|
||||
{
|
||||
sightRange += *_farSightDistance;
|
||||
}
|
||||
|
||||
return sightRange;
|
||||
}
|
||||
|
||||
bool Player::IsWorldObjectOutOfSightRange(WorldObject const* target) const
|
||||
{
|
||||
// Special handling for Infinite visibility override objects -> they are zone wide visible
|
||||
if (target->GetVisibilityOverrideType() == VisibilityDistanceType::Infinite)
|
||||
{
|
||||
// Same zone, always visible
|
||||
if (target->GetZoneId() == GetZoneId())
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if out of range
|
||||
return !m_seer->IsWithinDist(target, GetSightRange(target), true);
|
||||
}
|
||||
|
||||
std::string Player::GetPlayerName()
|
||||
{
|
||||
std::string name = GetName();
|
||||
|
||||
Reference in New Issue
Block a user