1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 22:53:50 +00:00

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;
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);
}

View file

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