feat(Core/Visibility): Far visibility worldobjects (#22828)

This commit is contained in:
Takenbacon
2025-09-07 04:02:03 -07:00
committed by GitHub
parent d55851c513
commit a28824df85
22 changed files with 461 additions and 156 deletions

View File

@@ -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();