From 0f83799770cf502fec89c3e13b325663162f2f93 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 12 Apr 2015 00:04:11 +0300 Subject: Fix move animation after path is empty. This fix random stand animation while moving. --- src/being/being.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/being/being.cpp') diff --git a/src/being/being.cpp b/src/being/being.cpp index 6bb17ad4b..393e45dd6 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -160,6 +160,7 @@ Being::Being(const int id, mAttackRange(1), mLastAttackX(0), mLastAttackY(0), + mPreStandTime(0), mGender(Gender::UNSPECIFIED), mAction(BeingAction::STAND), mSubType(0xFFFF), @@ -1434,7 +1435,8 @@ void Being::nextTile() { if (mPath.empty()) { - setAction(BeingAction::STAND, 0); + mAction = BeingAction::PRESTAND; + mPreStandTime = tick_time; return; } @@ -1536,6 +1538,13 @@ void Being::logic() break; } + + case BeingAction::PRESTAND: + { + if (get_elapsed_time(mPreStandTime) > 100) + setAction(BeingAction::STAND, 0); + break; + } } if (mAction == BeingAction::MOVE || mNeedPosUpdate) -- cgit v1.2.3-60-g2f50