[7826] Avoid use GetDistance* that used slow sqrt call where possible, other related speedups.

This commit is contained in:
VladimirMangos 2009-05-14 18:16:03 +04:00
parent ff80f14d2d
commit 788cdf9b3a
21 changed files with 158 additions and 93 deletions

View file

@ -125,7 +125,7 @@ void GuardAI::UpdateAI(const uint32 /*diff*/)
bool GuardAI::IsVisible(Unit *pl) const
{
return m_creature->GetDistance(pl) < sWorld.getConfig(CONFIG_SIGHT_GUARDER)
return m_creature->IsWithinDist(pl,sWorld.getConfig(CONFIG_SIGHT_GUARDER))
&& pl->isVisibleForOrDetect(m_creature,true);
}