From 35afca876ece89be5b282c73a200d0d3c5d27fe0 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sat, 16 Dec 2006 19:04:58 +0000 Subject: Fixed connection dialog visibility and fixed issues with walking one tile too many and changing direction towards an obstacle. --- src/localplayer.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/localplayer.cpp') 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); -- cgit v1.2.3-70-g09d2