summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2006-12-16 19:04:58 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2006-12-16 19:04:58 +0000
commit35afca876ece89be5b282c73a200d0d3c5d27fe0 (patch)
tree90033c7dfd025ab0d90304bfc5440c9aaa3bbcc5 /src/localplayer.cpp
parent201a9a7d4fdf1ff7cb8ffc75d606bfaf6d38a0f6 (diff)
downloadmana-35afca876ece89be5b282c73a200d0d3c5d27fe0.tar.gz
mana-35afca876ece89be5b282c73a200d0d3c5d27fe0.tar.bz2
mana-35afca876ece89be5b282c73a200d0d3c5d27fe0.tar.xz
mana-35afca876ece89be5b282c73a200d0d3c5d27fe0.zip
Fixed connection dialog visibility and fixed issues with walking one tile too
many and changing direction towards an obstacle.
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 f842042c..2e583404 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -181,11 +181,6 @@ void LocalPlayer::pickUp(FloorItem *item)
void LocalPlayer::walk(unsigned char dir)
{
- if (mWalkingDir != dir)
- {
- mWalkingDir = dir;
- }
-
if (!mMap || !dir)
return;
@@ -248,6 +243,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)
{
MessageOut outMsg(mNetwork);