summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r--src/localplayer.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 721c71b1a..28ffc4cf5 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -3452,6 +3452,14 @@ int LocalPlayer::getPathLength(Being* being)
}
}
+int LocalPlayer::getAttackRange2()
+{
+ int range = getAttackRange();
+ if (range == 1)
+ range = 2;
+ return range;
+}
+
void LocalPlayer::attack2(Being *target, bool keep, bool dontChangeEquipment)
{
if (!dontChangeEquipment && target)
@@ -3459,7 +3467,7 @@ void LocalPlayer::attack2(Being *target, bool keep, bool dontChangeEquipment)
if ((!target || getAttackType() == 0 || getAttackType() == 3)
|| (withinAttackRange(target, true, 1)
- && getPathLength(target) <= getAttackRange() + 1))
+ && getPathLength(target) <= getAttackRange2()))
{
attack(target, keep);
if (getAttackType() == 2)