summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
diff options
context:
space:
mode:
authorBertram <bertram@cegetel.net>2009-10-16 01:12:09 +0200
committerBertram <bertram@cegetel.net>2009-10-16 01:12:09 +0200
commitae8c3e89728ddc1f8e91e6e54ded039fd1fa600f (patch)
tree0191e06aeab32bda1f3fa6fcfdbee5714d95dc5a /src/localplayer.cpp
parent7da8ae1c1463a9659d776ff497ad18157cc2917c (diff)
downloadmana-ae8c3e89728ddc1f8e91e6e54ded039fd1fa600f.tar.gz
mana-ae8c3e89728ddc1f8e91e6e54ded039fd1fa600f.tar.bz2
mana-ae8c3e89728ddc1f8e91e6e54ded039fd1fa600f.tar.xz
mana-ae8c3e89728ddc1f8e91e6e54ded039fd1fa600f.zip
Made the keyboard walking pixel exact again.
What's left is working on player corner handling and directions while walking.
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r--src/localplayer.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 65f1fcc7..78988aa1 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -103,6 +103,7 @@ LocalPlayer::LocalPlayer(int id, int job, Map *map):
mTrading(false), mGoingToTarget(false), mKeepAttacking(false),
mLastAction(-1),
mWalkingDir(0),
+ mPathSetByMouse(false),
mDestX(0), mDestY(0),
mInventory(new Inventory(INVENTORY_SIZE)),
#ifdef TMWSERV_SUPPORT
@@ -538,10 +539,12 @@ void LocalPlayer::setWalkingDir(int dir)
player_node->stopWalking(false);
// Else, he is not pressing a key,
- // And the current path is over. Then, stop (sending to server).
- else if (!dir && mPath.empty())
+ // and the current path hasn't been sent by mouse,
+ // then, stop (sending to server).
+ else if (!dir)
{
- player_node->stopWalking(true);
+ if (!mPathSetByMouse)
+ player_node->stopWalking(true);
return;
}
@@ -641,6 +644,9 @@ void LocalPlayer::stopWalking(bool sendToServer)
setAction(STAND);
}
+ // No path set anymore, so we reset the path by mouse flag
+ mPathSetByMouse = false;
+
clearPath();
}