1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-02 00:15:48 +00:00

Fix idle state reset

This commit is contained in:
Capostrophic 2019-12-03 20:50:57 +03:00
parent eacc185534
commit 86c8fe386b

View file

@ -576,6 +576,13 @@ void CharacterController::refreshMovementAnims(const std::string& weapShortGroup
mCurrentMovement = movementAnimName; mCurrentMovement = movementAnimName;
if(!mCurrentMovement.empty()) if(!mCurrentMovement.empty())
{ {
if (resetIdle)
{
mAnimation->disable(mCurrentIdle);
mIdleState = CharState_None;
idle = CharState_None;
}
// For non-flying creatures, MW uses the Walk animation to calculate the animation velocity // For non-flying creatures, MW uses the Walk animation to calculate the animation velocity
// even if we are running. This must be replicated, otherwise the observed speed would differ drastically. // even if we are running. This must be replicated, otherwise the observed speed would differ drastically.
std::string anim = mCurrentMovement; std::string anim = mCurrentMovement;
@ -615,9 +622,6 @@ void CharacterController::refreshMovementAnims(const std::string& weapShortGroup
mAnimation->play(mCurrentMovement, Priority_Movement, movemask, false, mAnimation->play(mCurrentMovement, Priority_Movement, movemask, false,
1.f, "start", "stop", startpoint, ~0ul, true); 1.f, "start", "stop", startpoint, ~0ul, true);
if (resetIdle)
mAnimation->disable(mCurrentIdle);
} }
else else
mMovementState = CharState_None; mMovementState = CharState_None;
@ -1656,6 +1660,7 @@ bool CharacterController::updateWeaponState(CharacterState& idle)
mIdleState != CharState_IdleSneak && mIdleState != CharState_IdleSwim) mIdleState != CharState_IdleSneak && mIdleState != CharState_IdleSwim)
{ {
mAnimation->disable(mCurrentIdle); mAnimation->disable(mCurrentIdle);
mIdleState = CharState_None;
} }
animPlaying = mAnimation->getInfo(mCurrentWeapon, &complete); animPlaying = mAnimation->getInfo(mCurrentWeapon, &complete);