diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-01-22 00:13:32 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-01-22 00:13:32 +0300 |
commit | 4e50d7314f67f6e6fc307a6270d2b6dab598f5ea (patch) | |
tree | 7fa0da0524b32b5ed578f8fc7b25456f3f5b51b5 /src/being/localplayer.cpp | |
parent | 9cbd54f5fe3b06eabdb1290ebbffe42257f460f8 (diff) | |
download | plus-4e50d7314f67f6e6fc307a6270d2b6dab598f5ea.tar.gz plus-4e50d7314f67f6e6fc307a6270d2b6dab598f5ea.tar.bz2 plus-4e50d7314f67f6e6fc307a6270d2b6dab598f5ea.tar.xz plus-4e50d7314f67f6e6fc307a6270d2b6dab598f5ea.zip |
Impliment server feature haveAttackDirections.
Diffstat (limited to 'src/being/localplayer.cpp')
-rw-r--r-- | src/being/localplayer.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index efe6bf3bb..a6636ba77 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -748,19 +748,22 @@ void LocalPlayer::attack(Being *const target, const bool keep, if (mAction != BeingAction::STAND && mAction != BeingAction::SIT) return; - if (abs(dist_y) >= abs(dist_x)) + if (!serverFeatures->haveAttackDirections()) { - if (dist_y > 0) - setDirection(BeingDirection::DOWN); - else - setDirection(BeingDirection::UP); - } - else - { - if (dist_x > 0) - setDirection(BeingDirection::RIGHT); + if (abs(dist_y) >= abs(dist_x)) + { + if (dist_y > 0) + setDirection(BeingDirection::DOWN); + else + setDirection(BeingDirection::UP); + } else - setDirection(BeingDirection::LEFT); + { + if (dist_x > 0) + setDirection(BeingDirection::RIGHT); + else + setDirection(BeingDirection::LEFT); + } } mActionTime = tick_time; |