summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-09-05 20:07:03 +0300
committerAndrei Karas <akaras@inbox.ru>2011-09-05 20:07:03 +0300
commit4a73dd1338353a5d23c7de970c47995ee32ff500 (patch)
tree451ecc41dbb25eb8faef2fd991fab40ab817a90e /src
parentaf4727577f39720564b4339de267aa0aae7af4a5 (diff)
downloadmanaplus-4a73dd1338353a5d23c7de970c47995ee32ff500.tar.gz
manaplus-4a73dd1338353a5d23c7de970c47995ee32ff500.tar.bz2
manaplus-4a73dd1338353a5d23c7de970c47995ee32ff500.tar.xz
manaplus-4a73dd1338353a5d23c7de970c47995ee32ff500.zip
Fix move animation if moving with mouse or moving to navigation point.
Diffstat (limited to 'src')
-rw-r--r--src/localplayer.cpp18
-rw-r--r--src/localplayer.h1
2 files changed, 16 insertions, 3 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index e9386a5ee..c91532227 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -123,7 +123,8 @@ LocalPlayer::LocalPlayer(int id, int subtype):
mLastHitFrom(""),
mWaitFor(""),
mAdvertTime(0),
- mBlockAdvert(false)
+ mBlockAdvert(false),
+ mNextStep(false)
{
logger->log1("LocalPlayer::LocalPlayer");
@@ -222,8 +223,9 @@ void LocalPlayer::logic()
if (mActivityTime == 0 || mLastAction != -1)
mActivityTime = cur_time;
- if (mAction != MOVE && !mNavigatePath.empty())
+ if ((mAction != MOVE || mNextStep) && !mNavigatePath.empty())
{
+ mNextStep = false;
int dist = 5;
if (!mSyncPlayerMove)
dist = 20;
@@ -844,7 +846,17 @@ void LocalPlayer::nextTile(unsigned char dir A_UNUSED = 0)
mPath.clear();
}
- Being::nextTile();
+ if (mPath.empty())
+ {
+ if (mNavigatePath.empty() || mAction != MOVE)
+ setAction(STAND);
+ else
+ mNextStep = true;
+ }
+ else
+ {
+ Being::nextTile();
+ }
}
#ifdef MANASERV_SUPPORT
else
diff --git a/src/localplayer.h b/src/localplayer.h
index ebc347ce0..1f2790e88 100644
--- a/src/localplayer.h
+++ b/src/localplayer.h
@@ -601,6 +601,7 @@ class LocalPlayer : public Being, public ActorSpriteListener,
bool mBlockAdvert;
bool mEnableAdvert;
bool mTradebot;
+ bool mNextStep;
};
extern LocalPlayer *player_node;