diff options
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r-- | src/localplayer.cpp | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp index 212b896d..3759e5a3 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -844,25 +844,7 @@ void LocalPlayer::attack(Being *target, bool keep) setTarget(target); } - Vector plaPos = this->getPosition(); - Vector tarPos = mTarget->getPosition(); - int dist_x = plaPos.x - tarPos.x; - int dist_y = plaPos.y - tarPos.y; - - if (abs(dist_y) >= abs(dist_x)) - { - if (dist_y < 0) - setDirection(DOWN); - else - setDirection(UP); - } - else - { - if (dist_x < 0) - setDirection(RIGHT); - else - setDirection(LEFT); - } + lookAt(mTarget->getPosition()); mLastActionTime = tick_time; |