Fix weapon animations playing on the lowerbody when swimming

This commit is contained in:
scrawl 2015-07-31 00:52:34 +02:00
parent e8cbdcfb1e
commit f326b8e5d2
2 changed files with 6 additions and 1 deletions

View file

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

View file

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