diff options
author | David Athay <ko2fan@gmail.com> | 2009-05-26 15:25:55 +0100 |
---|---|---|
committer | David Athay <ko2fan@gmail.com> | 2009-05-26 15:33:49 +0100 |
commit | 802481a7e19c45da2128de18359b44f1a95c476c (patch) | |
tree | 7c9bc341c16547ed30fe7212b0d672607ce19bf5 /src/localplayer.cpp | |
parent | cd5ca5b198f7345f363dba322f49a8e3703dd431 (diff) | |
download | mana-802481a7e19c45da2128de18359b44f1a95c476c.tar.gz mana-802481a7e19c45da2128de18359b44f1a95c476c.tar.bz2 mana-802481a7e19c45da2128de18359b44f1a95c476c.tar.xz mana-802481a7e19c45da2128de18359b44f1a95c476c.zip |
Fixed attacking for tmwserv. Added back attacking with keyboard for tmwserv.
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r-- | src/localplayer.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp index c9dc771d..9cdf0bf8 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -703,6 +703,22 @@ void LocalPlayer::attack(Being *target, bool keep) return; #endif +#ifdef TMWSERV_SUPPORT + 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); + } +#else if (abs(dist_y) >= abs(dist_x)) { if (dist_y > 0) @@ -717,6 +733,7 @@ void LocalPlayer::attack(Being *target, bool keep) else setDirection(LEFT); } +#endif #ifdef TMWSERV_SUPPORT mLastAction = tick_time; @@ -738,9 +755,6 @@ void LocalPlayer::attack(Being *target, bool keep) sound.playSfx("sfx/fist-swish.ogg"); } -#ifdef TMWSERV_SUPPORT - if (mLastAction == STAND) -#endif Net::getPlayerHandler()->attack(target->getId()); #ifdef EATHENA_SUPPORT if (!keep) |