summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2010-11-01 20:04:43 +0100
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2010-11-01 20:04:43 +0100
commit38f7cd9a9a49dc91b1c2e69b48308bd16d4b5aad (patch)
tree81d0e898790264114683cca9cfd3355bea114415 /src/localplayer.cpp
parentc5e341f7b5f5e4efcabd09e00e177bb873db8097 (diff)
parent1f69108501c4bf51f3adac9ffbf7a7631fb12b9a (diff)
downloadmana-38f7cd9a9a49dc91b1c2e69b48308bd16d4b5aad.tar.gz
mana-38f7cd9a9a49dc91b1c2e69b48308bd16d4b5aad.tar.bz2
mana-38f7cd9a9a49dc91b1c2e69b48308bd16d4b5aad.tar.xz
mana-38f7cd9a9a49dc91b1c2e69b48308bd16d4b5aad.zip
Merge branch '0.5' of gitorious.org:mana/mana
Conflicts: src/being.cpp src/client.cpp src/commandhandler.cpp src/gui/setup_video.cpp src/gui/socialwindow.cpp src/gui/viewport.cpp src/gui/widgets/browserbox.cpp src/gui/widgets/itemcontainer.cpp src/imageparticle.cpp src/localplayer.cpp src/localplayer.h src/map.cpp src/net/tmwa/beinghandler.cpp src/particle.cpp src/particle.h src/player.cpp src/player.h
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r--src/localplayer.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 15f7e11d..b60ee6f7 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -84,7 +84,8 @@ LocalPlayer::LocalPlayer(int id, int subtype):
mWalkingDir(0),
mPathSetByMouse(false),
mLocalWalkTime(-1),
- mMessageTime(0)
+ mMessageTime(0),
+ mShowIp(false)
{
listen("Attributes");
@@ -635,8 +636,9 @@ void LocalPlayer::pickUp(FloorItem *item)
if (!item)
return;
- int dx = item->getTileX() - (int) getPosition().x / 32;
- int dy = item->getTileY() - (int) getPosition().y / 32;
+ int dx = item->getTileX() - (int) getPosition().x / mMap->getTileWidth();
+ int dy = item->getTileY() - ((int) getPosition().y - 1)
+ / mMap->getTileHeight();
if (dx * dx + dy * dy < 4)
{
@@ -931,20 +933,23 @@ void LocalPlayer::attack(Being *target, bool keep)
if (mAction != STAND)
return;
+ Uint8 direction = 0;
if (abs(dist_y) >= abs(dist_x))
{
if (dist_y > 0)
- setDirection(DOWN);
+ direction = DOWN;
else
- setDirection(UP);
+ direction = UP;
}
else
{
if (dist_x > 0)
- setDirection(RIGHT);
+ direction = RIGHT;
else
- setDirection(LEFT);
+ direction = LEFT;
}
+ Net::getPlayerHandler()->setDirection(direction);
+ setDirection(direction);
mActionTime = tick_time;
mTargetTime = tick_time;