mirror of
https://github.com/mangosfour/server.git
synced 2025-12-30 10:37:12 +00:00
[7826] Avoid use GetDistance* that used slow sqrt call where possible, other related speedups.
This commit is contained in:
parent
ff80f14d2d
commit
788cdf9b3a
21 changed files with 158 additions and 93 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue