From 0b38e165f70927814202b9c4f7c700b9e69ee8c6 Mon Sep 17 00:00:00 2001 From: Alexei Kotov Date: Fri, 17 Jun 2022 09:53:13 +0000 Subject: [PATCH] Avoid clearing the current weapon animation group if it's still going to be in use --- apps/openmw/mwmechanics/character.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index c7e5cf70a3..8766230e9c 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -390,7 +390,8 @@ void CharacterController::refreshHitRecoilAnims() // Cancel upper body animations if (isKnockedOut() || isKnockedDown()) { - clearStateAnimation(mCurrentWeapon); + if (!mCurrentWeapon.empty()) + mAnimation->disable(mCurrentWeapon); if (mUpperBodyState > UpperCharState_WeapEquiped) { mUpperBodyState = UpperCharState_WeapEquiped; @@ -1148,7 +1149,8 @@ bool CharacterController::updateState(CharacterState idle) if (isStillWeapon && mWeaponType != weaptype && mUpperBodyState > UpperCharState_WeapEquiped) { forcestateupdate = true; - clearStateAnimation(mCurrentWeapon); + if (!mCurrentWeapon.empty()) + mAnimation->disable(mCurrentWeapon); mUpperBodyState = UpperCharState_WeapEquiped; setAttackingOrSpell(false); mAnimation->showWeapons(true); @@ -1310,7 +1312,8 @@ bool CharacterController::updateState(CharacterState idle) if (!ammunition && mUpperBodyState > UpperCharState_WeapEquiped) { - clearStateAnimation(mCurrentWeapon); + if (!mCurrentWeapon.empty()) + mAnimation->disable(mCurrentWeapon); mUpperBodyState = UpperCharState_WeapEquiped; } } @@ -1591,7 +1594,8 @@ bool CharacterController::updateState(CharacterState idle) if (mWeaponType > ESM::Weapon::None) mAnimation->showWeapons(true); } - clearStateAnimation(mCurrentWeapon); + if (!mCurrentWeapon.empty()) + mAnimation->disable(mCurrentWeapon); } }