From 35db7b83194bfcc4fc6abc1fb0da945ab63ab4a5 Mon Sep 17 00:00:00 2001 From: Alexei Kotov Date: Tue, 14 Jun 2022 01:00:00 +0300 Subject: [PATCH] Fix fallback for missing swim/sneak idle animations --- apps/openmw/mwmechanics/character.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index 1f1aa80856..84d28953d0 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -701,12 +701,16 @@ void CharacterController::refreshIdleAnims(CharacterState idle, bool force) size_t numLoops = ~0ul; std::string idleGroup = idleStateToAnimGroup(mIdleState); - MWRender::Animation::AnimPriority priority = getIdlePriority(mIdleState); // Only play "idleswim" or "idlesneak" if they exist. Otherwise, fallback to // "idle"+weapon or "idle". if ((mIdleState == CharState_IdleSwim || mIdleState == CharState_IdleSneak) && !mAnimation->hasAnimation(idleGroup)) - idleGroup = idleStateToAnimGroup(CharState_Idle); + { + mIdleState = CharState_Idle; + idleGroup = idleStateToAnimGroup(mIdleState); + } + + MWRender::Animation::AnimPriority priority = getIdlePriority(mIdleState); if (idleGroup.empty()) {