diff options
-rw-r--r-- | src/localplayer.cpp | 10 | ||||
-rw-r--r-- | src/localplayer.h | 2 |
2 files changed, 11 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) diff --git a/src/localplayer.h b/src/localplayer.h index bbd17f53c..447306994 100644 --- a/src/localplayer.h +++ b/src/localplayer.h @@ -139,6 +139,8 @@ class LocalPlayer : public Being, public ActorSpriteListener, */ int getAttackRange(); + int getAttackRange2(); + void attack(Being *target = NULL, bool keep = false, bool dontChangeEquipment = false); |