mirror of
https://github.com/mangosfour/server.git
synced 2025-12-27 01:37:04 +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
|
|
@ -288,8 +288,7 @@ void PetAI::UpdateAI(const uint32 diff)
|
|||
|
||||
bool PetAI::_isVisible(Unit *u) const
|
||||
{
|
||||
//return false; //( ((Creature*)&i_pet)->GetDistanceSq(u) * 1.0<= sWorld.getConfig(CONFIG_SIGHT_GUARDER) && !u->m_stealth && u->isAlive());
|
||||
return m_creature->GetDistance(u) < sWorld.getConfig(CONFIG_SIGHT_GUARDER)
|
||||
return m_creature->IsWithinDist(u,sWorld.getConfig(CONFIG_SIGHT_GUARDER))
|
||||
&& u->isVisibleForOrDetect(m_creature,true);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue