summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2012-02-02 17:42:31 +0100
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2012-02-02 18:19:58 +0100
commit19bc88f34713968864922f8f3f2342d10c4f4dbd (patch)
tree5affb1b26aa1d71b49e1fd7916e41c43df1399c8 /src/localplayer.cpp
parent4bcf9fc3218e37eccbebe52a005a37bd8f06a823 (diff)
downloadmana-client-19bc88f34713968864922f8f3f2342d10c4f4dbd.tar.gz
mana-client-19bc88f34713968864922f8f3f2342d10c4f4dbd.tar.bz2
mana-client-19bc88f34713968864922f8f3f2342d10c4f4dbd.tar.xz
mana-client-19bc88f34713968864922f8f3f2342d10c4f4dbd.zip
Fixed player's character direction.
Made the player's character look at where it is going even when using the keyboard, by setting its direction after getting the actual destination, and not before. I also used the lookAt() function to avoid yet another custom way of setting the direction. Reviewed-by: Erik Schilling
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r--src/localplayer.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 8d6ad542..efdcaa60 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -546,6 +546,7 @@ void LocalPlayer::nextTile(unsigned char dir = 0)
if ((int)pos.x != destination.x
|| (int)pos.y != destination.y)
{
+ lookAt(destination);
setDestination(destination.x, destination.y);
}
else if (dir != mDirection)
@@ -759,9 +760,6 @@ void LocalPlayer::startWalking(unsigned char dir)
if (dir & RIGHT)
dx++;
- // Update the direction when the walk just start
- setDirection(dir);
-
nextTile(dir);
}