1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-03 19:45:34 +00:00

Avoid clearing the current weapon animation group if it's still going to be in use

This commit is contained in:
Alexei Kotov 2022-06-17 09:53:13 +00:00 committed by jvoisin
parent 28c97c22b9
commit 0b38e165f7

View file

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