diff options
author | David Athay <ko2fan@gmail.com> | 2009-05-19 15:58:58 +0100 |
---|---|---|
committer | David Athay <ko2fan@gmail.com> | 2009-05-19 15:58:58 +0100 |
commit | e975b11e1885457295a51778d8337b097549228d (patch) | |
tree | 09f340afb43894c87f38a0b198392305f67d6ee0 /src/gui/viewport.cpp | |
parent | 3dd404ee8a02958089bf2c6901fb877d2fae760e (diff) | |
download | mana-e975b11e1885457295a51778d8337b097549228d.tar.gz mana-e975b11e1885457295a51778d8337b097549228d.tar.bz2 mana-e975b11e1885457295a51778d8337b097549228d.tar.xz mana-e975b11e1885457295a51778d8337b097549228d.zip |
Fixed targeting and warn on attack-range not being found in itemdb.
Tried to make the client continue attacking (it does not need to send
attack packets, but just continue playing attack animation and sounds).
Now logs a warning when a weapon is found without an attack-range (I
keep finding weapons with an attack-range of 0 which makes it hard to
target monsters).
Diffstat (limited to 'src/gui/viewport.cpp')
-rw-r--r-- | src/gui/viewport.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index cbde95c4..787723c0 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -357,20 +357,12 @@ void Viewport::mousePressed(gcn::MouseEvent &event) if (player_node->withinAttackRange(being) || keyboard.isKeyActive(keyboard.KEY_ATTACK)) { - player_node->setGotoTarget(being); - player_node->attack(being, !keyboard.isKeyActive(keyboard.KEY_TARGET)); - } else { -#ifdef TMWSERV_SUPPORT - player_node->setDestination(event.getX() + (int) mPixelViewX, - event.getY() + (int) mPixelViewY); -#else - player_node->setDestination(tilex, tiley); -#endif + player_node->setGotoTarget(being); } break; default: @@ -399,9 +391,9 @@ void Viewport::mousePressed(gcn::MouseEvent &event) event.getY() + (int) mPixelViewY); } #else - player_node->stopAttack(); player_node->setDestination(tilex, tiley); #endif + player_node->stopAttack(); mPlayerFollowMouse = true; } } |