diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/being/being.cpp | 5 | ||||
-rw-r--r-- | src/being/localplayer.cpp | 25 |
2 files changed, 17 insertions, 13 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index 2e64a9cd9..616acf99a 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -813,13 +813,14 @@ void Being::handleAttack(Being *const victim, const int damage, reset(); mActionTime = tick_time; - if (this != localPlayer) + if (!serverFeatures->haveAttackDirections() && this != localPlayer) { const uint8_t dir = calcDirection(victim->getTileX(), victim->getTileY()); if (dir) setDirection(dir); } + if (damage && victim->mType == ActorType::Player && victim->mAction == BeingAction::SIT) { @@ -868,7 +869,7 @@ void Being::handleSkill(Being *const victim, const int damage, reset(); mActionTime = tick_time; - if (this != localPlayer) + if (!serverFeatures->haveAttackDirections() && this != localPlayer) { const uint8_t dir = calcDirection(victim->getTileX(), victim->getTileY()); 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; |