From 8ffc1a6e4ce588cdf9b54e26616c4a92729f7ffd Mon Sep 17 00:00:00 2001 From: megamage Date: Sat, 6 Dec 2008 10:44:53 -0600 Subject: *Apply range mod also for melee spells. --HG-- branch : trunk --- src/game/Unit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/game/Unit.cpp') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 862c9a6c2eb..36ba1af2e3c 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -435,7 +435,7 @@ bool Unit::IsWithinCombatRange(Unit *obj, float dist2compare) const return distsq < maxdist * maxdist; } -bool Unit::IsWithinMeleeRange(Unit *obj) const +bool Unit::IsWithinMeleeRange(Unit *obj, float dist) const { if (!obj || !IsInMap(obj)) return false; @@ -445,7 +445,7 @@ bool Unit::IsWithinMeleeRange(Unit *obj) const float distsq = dx*dx + dy*dy + dz*dz; float sizefactor = GetMeleeReach() + obj->GetMeleeReach(); - float maxdist = MELEE_RANGE + sizefactor; + float maxdist = dist + sizefactor; return distsq < maxdist * maxdist; } -- cgit v1.2.3