fix(Core/Spells): Far Sight auras are supposed to extend view distance and allows seeing objects from further distance (#7068)

- Closes #5793.
This commit is contained in:
UltraNix
2021-07-26 10:23:08 +02:00
committed by GitHub
parent 1f3a097761
commit e37dba8df6
10 changed files with 106 additions and 19 deletions

View File

@@ -15154,3 +15154,29 @@ void Player::SetServerSideVisibilityDetect(ServerSideVisibilityType type, Accoun
m_serverSideVisibilityDetect.SetValue(type, sec);
}
void Player::SetFarSightDistance(float radius)
{
_farSightDistance = radius;
}
void Player::ResetFarSightDistance()
{
_farSightDistance.reset();
}
Optional<float> Player::GetFarSightDistance() const
{
return _farSightDistance;
}
float Player::GetSightRange(const WorldObject* target) const
{
float sightRange = WorldObject::GetSightRange(target);
if (_farSightDistance)
{
sightRange += *_farSightDistance;
}
return sightRange;
}