[svn] Add Unit::IsWithinCombatDist function to check melee range and spell range (now range is related to the attacker's bounding_radius and target's combat_reach, not sure if both should be combat_reach).

--HG--
branch : trunk
This commit is contained in:
megamage
2008-10-19 14:42:12 -05:00
parent e7519059c9
commit 672d304a44
5 changed files with 21 additions and 6 deletions
+1
View File
@@ -718,6 +718,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
bool isAttackReady(WeaponAttackType type = BASE_ATTACK) const { return m_attackTimer[type] == 0; }
bool haveOffhandWeapon() const;
bool canReachWithAttack(Unit *pVictim) const;
bool IsWithinCombatDist(Unit *obj, float dist2compare) const;
uint32 m_extraAttacks;
void _addAttacker(Unit *pAttacker) // must be called only from Unit::Attack(Unit*)