1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 07:53:53 +00:00

Fix fallback for missing swim/sneak idle animations

This commit is contained in:
Alexei Kotov 2022-06-14 01:00:00 +03:00
parent 471c111fa2
commit 35db7b8319

View file

@ -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())
{