diff options
Diffstat (limited to 'src/game/Unit.h')
| -rw-r--r-- | src/game/Unit.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/game/Unit.h b/src/game/Unit.h index 24722645eaf..7f93ede83b4 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -771,10 +771,10 @@ class TRINITY_DLL_SPEC Unit : public WorldObject bool haveOffhandWeapon() const; bool CanDualWield() const { return m_canDualWield; } void SetCanDualWield(bool value) { m_canDualWield = value; } - bool canReachWithAttack(Unit *pVictim) const; float GetCombatReach() const { return m_floatValues[UNIT_FIELD_COMBATREACH]; } - bool IsWithinCombatDist(Unit *obj, float dist2compare) const; - bool IsWithinMeleeRange(Unit *obj) const { return IsWithinCombatDist(obj, ATTACK_DISTANCE); } + float GetMeleeReach() const { float reach = m_floatValues[UNIT_FIELD_COMBATREACH]; return reach > MIN_MELEE_REACH ? reach : MIN_MELEE_REACH; } + bool IsWithinCombatRange(Unit *obj, float dist2compare) const; + bool IsWithinMeleeRange(Unit *obj) const; void GetRandomContactPoint( const Unit* target, float &x, float &y, float &z, float distance2dMin, float distance2dMax ) const; uint32 m_extraAttacks; bool m_canDualWield; @@ -810,7 +810,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject Unit* getVictim() const { return m_attacking; } void CombatStop(bool cast = false); void CombatStopWithPets(bool cast = false); - Unit* SelectNearbyTarget(float dist = ATTACK_DISTANCE) const; + Unit* SelectNearbyTarget(float dist = NOMINAL_MELEE_RANGE) const; void addUnitState(uint32 f) { m_state |= f; } bool hasUnitState(const uint32 f) const { return (m_state & f); } |
