[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

@ -89,7 +89,7 @@ struct MANGOS_DLL_DECL ScriptedAI : public CreatureAI
// Is unit visible for MoveInLineOfSight
bool IsVisible(Unit* who) const
{
return !who->HasStealthAura() && m_creature->GetDistance(who) <= VISIBLE_RANGE;
return !who->HasStealthAura() && m_creature->IsWithinDist(who,VISIBLE_RANGE);
}
// Called at World update tick