summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorDavid Athay <ko2fan@gmail.com>2009-05-19 15:58:58 +0100
committerDavid Athay <ko2fan@gmail.com>2009-05-19 15:58:58 +0100
commite975b11e1885457295a51778d8337b097549228d (patch)
tree09f340afb43894c87f38a0b198392305f67d6ee0 /src/gui
parent3dd404ee8a02958089bf2c6901fb877d2fae760e (diff)
downloadmana-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')
-rw-r--r--src/gui/viewport.cpp12
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;
}
}