diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-16 16:44:21 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-16 16:44:21 +0300 |
commit | 4d54d36ed8e4bcc34e5b9f90e2126fadb490c34f (patch) | |
tree | 3bea875b8d320d8ba633eefa2482dfc6f3fa631b /src/being | |
parent | 8185a857a4d9152b3dda7f6b5649a27427010605 (diff) | |
download | manaverse-4d54d36ed8e4bcc34e5b9f90e2126fadb490c34f.tar.gz manaverse-4d54d36ed8e4bcc34e5b9f90e2126fadb490c34f.tar.bz2 manaverse-4d54d36ed8e4bcc34e5b9f90e2126fadb490c34f.tar.xz manaverse-4d54d36ed8e4bcc34e5b9f90e2126fadb490c34f.zip |
Add server feature haveBrokenPlayerAttackDistance.
Diffstat (limited to 'src/being')
-rw-r--r-- | src/being/localplayer.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index fd3acd4f9..d5e32316c 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -1117,18 +1117,20 @@ void LocalPlayer::moveToTarget(int dist) dist = settings.moveToTargetType; if (dist != 0) { + const bool broken = Net::getServerFeatures() + ->haveBrokenPlayerAttackDistance(); switch (dist) { case 10: dist = mAttackRange; - if (dist == 1 && serverVersion < 1) + if (dist == 1 && broken) dist = 2; break; case 11: dist = mAttackRange - 1; if (dist < 1) dist = 1; - if (dist == 1 && serverVersion < 1) + if (dist == 1 && broken) dist = 2; break; default: @@ -2746,10 +2748,12 @@ void LocalPlayer::attack2(Being *const target, const bool keep, if (!dontChangeEquipment && target) changeEquipmentBeforeAttack(target); + const bool broken = Net::getServerFeatures() + ->haveBrokenPlayerAttackDistance(); + // probably need cache getPathLength(target) if ((!target || settings.attackType == 0 || settings.attackType == 3) - || (withinAttackRange(target, serverVersion < 1, - serverVersion < 1 ? 1 : 0) + || (withinAttackRange(target, broken, broken ? 1 : 0) && getPathLength(target) <= getAttackRange2())) { attack(target, keep); |