summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r--src/localplayer.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index ba7b6117..8076c538 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -166,11 +166,6 @@ void LocalPlayer::pickUp(FloorItem *item)
void LocalPlayer::walk(unsigned char dir)
{
- if (mWalkingDir != dir)
- {
- mWalkingDir = dir;
- }
-
if (!mMap || !dir)
return;
@@ -237,6 +232,20 @@ void LocalPlayer::setDestination(Uint16 x, Uint16 y)
Being::setDestination(x, y);
}
+void LocalPlayer::setWalkingDir(int dir)
+{
+ if (mWalkingDir != dir)
+ {
+ mWalkingDir = dir;
+ }
+
+ // If we're not already walking, start walking.
+ if (mAction != WALK && dir)
+ {
+ walk(dir);
+ }
+}
+
void LocalPlayer::raiseAttribute(Attribute attr)
{
// XXX Convert for new server