diff options
| author | megamage <none@none> | 2009-05-14 16:50:47 -0500 |
|---|---|---|
| committer | megamage <none@none> | 2009-05-14 16:50:47 -0500 |
| commit | 047cc95388a67d5f33cb86082bbef03f654acec1 (patch) | |
| tree | 90547d4892aa217a58408b3353fe943dcc51bb7b /src/game/Creature.cpp | |
| parent | 811eee356ddd3c0b486a828b39822daffd8ac97e (diff) | |
*Add some distance check functions. By VladimirMangos.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Creature.cpp')
| -rw-r--r-- | src/game/Creature.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index f322d8326e1..8d7b877d4f5 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -2058,12 +2058,12 @@ bool Creature::IsOutOfThreatArea(Unit* pVictim) const if(sMapStore.LookupEntry(GetMapId())->IsDungeon()) return false; - float length = pVictim->GetDistance(mHome_X, mHome_Y, mHome_Z); float AttackDist = GetAttackDistance(pVictim); uint32 ThreatRadius = sWorld.getConfig(CONFIG_THREAT_RADIUS); //Use AttackDistance in distance check if threat radius is lower. This prevents creature bounce in and out of combat every update tick. - return ( length > (ThreatRadius > AttackDist ? ThreatRadius : AttackDist)); + return !pVictim->IsWithinDist3d(mHome_X,mHome_Y,mHome_Z, + ThreatRadius > AttackDist ? ThreatRadius : AttackDist); } CreatureDataAddon const* Creature::GetCreatureAddon() const |
