|
|
|
@ -477,6 +477,11 @@ void CharacterController::refreshMovementAnims(const std::string& weapShortGroup
|
|
|
|
|
if (movement == mMovementState && idle == mIdleState && !force)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
// Reset idle if we actually play movement animations excepts of these cases:
|
|
|
|
|
// 1. When we play turning animations
|
|
|
|
|
// 2. When we use a fallback animation for lower body since movement animation for given weapon is missing (e.g. for crossbows and spellcasting)
|
|
|
|
|
bool resetIdle = (movement != CharState_None && !isTurning());
|
|
|
|
|
|
|
|
|
|
std::string movementAnimName;
|
|
|
|
|
MWRender::Animation::BlendMask movemask;
|
|
|
|
|
const StateInfo *movestate;
|
|
|
|
@ -508,14 +513,9 @@ void CharacterController::refreshMovementAnims(const std::string& weapShortGroup
|
|
|
|
|
// For upper body there will be idle animation.
|
|
|
|
|
if (movemask == MWRender::Animation::BlendMask_LowerBody && idle == CharState_None)
|
|
|
|
|
idle = CharState_Idle;
|
|
|
|
|
}
|
|
|
|
|
else if (idle == CharState_None)
|
|
|
|
|
{
|
|
|
|
|
// In the 1st-person mode use ground idle animations as fallback
|
|
|
|
|
if (mPtr == getPlayer() && MWBase::Environment::get().getWorld()->isFirstPerson())
|
|
|
|
|
idle = CharState_Idle;
|
|
|
|
|
else
|
|
|
|
|
idle = CharState_IdleSwim;
|
|
|
|
|
|
|
|
|
|
if (movemask == MWRender::Animation::BlendMask_LowerBody)
|
|
|
|
|
resetIdle = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -538,7 +538,11 @@ void CharacterController::refreshMovementAnims(const std::string& weapShortGroup
|
|
|
|
|
if(mAnimation->hasAnimation(weapMovementAnimName))
|
|
|
|
|
movementAnimName = weapMovementAnimName;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
movementAnimName = fallbackShortWeaponGroup(movementAnimName, &movemask);
|
|
|
|
|
if (movemask == MWRender::Animation::BlendMask_LowerBody)
|
|
|
|
|
resetIdle = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -565,6 +569,10 @@ void CharacterController::refreshMovementAnims(const std::string& weapShortGroup
|
|
|
|
|
mMovementAnimationControlled = true;
|
|
|
|
|
|
|
|
|
|
mAnimation->disable(mCurrentMovement);
|
|
|
|
|
|
|
|
|
|
if (!mAnimation->hasAnimation(movementAnimName))
|
|
|
|
|
movementAnimName.clear();
|
|
|
|
|
|
|
|
|
|
mCurrentMovement = movementAnimName;
|
|
|
|
|
if(!mCurrentMovement.empty())
|
|
|
|
|
{
|
|
|
|
@ -607,7 +615,12 @@ void CharacterController::refreshMovementAnims(const std::string& weapShortGroup
|
|
|
|
|
|
|
|
|
|
mAnimation->play(mCurrentMovement, Priority_Movement, movemask, false,
|
|
|
|
|
1.f, "start", "stop", startpoint, ~0ul, true);
|
|
|
|
|
|
|
|
|
|
if (resetIdle)
|
|
|
|
|
mAnimation->disable(mCurrentIdle);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
mMovementState = CharState_None;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2217,10 +2230,7 @@ void CharacterController::update(float duration, bool animationOnly)
|
|
|
|
|
|
|
|
|
|
if(mAnimQueue.empty() || inwater || sneak)
|
|
|
|
|
{
|
|
|
|
|
// Note: turning animations should not interrupt idle ones
|
|
|
|
|
if (movestate != CharState_None && !isTurning())
|
|
|
|
|
idlestate = CharState_None;
|
|
|
|
|
else if (inwater)
|
|
|
|
|
if (inwater)
|
|
|
|
|
idlestate = CharState_IdleSwim;
|
|
|
|
|
else if (sneak && !inJump)
|
|
|
|
|
idlestate = CharState_IdleSneak;
|
|
|
|
|