Fix weapon animations playing on the lowerbody when swimming

sceneinput
scrawl 10 years ago
parent e8cbdcfb1e
commit f326b8e5d2

@ -468,10 +468,14 @@ void CharacterController::refreshCurrentAnims(CharacterState idle, CharacterStat
mIdleState = idle;
std::string idle;
MWRender::Animation::AnimPriority idlePriority (Priority_Default);
// Only play "idleswim" or "idlesneak" if they exist. Otherwise, fallback to
// "idle"+weapon or "idle".
if(mIdleState == CharState_IdleSwim && mAnimation->hasAnimation("idleswim"))
{
idle = "idleswim";
idlePriority = Priority_SwimIdle;
}
else if(mIdleState == CharState_IdleSneak && mAnimation->hasAnimation("idlesneak"))
idle = "idlesneak";
else if(mIdleState != CharState_None)
@ -488,7 +492,7 @@ void CharacterController::refreshCurrentAnims(CharacterState idle, CharacterStat
mAnimation->disable(mCurrentIdle);
mCurrentIdle = idle;
if(!mCurrentIdle.empty())
mAnimation->play(mCurrentIdle, Priority_Default, MWRender::Animation::BlendMask_All, false,
mAnimation->play(mCurrentIdle, idlePriority, MWRender::Animation::BlendMask_All, false,
1.0f, "start", "stop", 0.0f, ~0ul, true);
}

@ -29,6 +29,7 @@ class CreatureStats;
enum Priority {
Priority_Default,
Priority_WeaponLowerBody,
Priority_SwimIdle,
Priority_Jump,
Priority_Movement,
Priority_Hit,

Loading…
Cancel
Save