From 0f7822fff8eb97aecdaa35c2dad6459b2f7f2427 Mon Sep 17 00:00:00 2001 From: Alexei Kotov Date: Sat, 11 Feb 2023 08:29:38 +0300 Subject: [PATCH] Unequip the weapon only after finishing the attack (bug #4610) --- CHANGELOG.md | 1 + apps/openmw/mwmechanics/character.cpp | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c771a3c0c9..f587fffcc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ Bug #4127: Weapon animation looks choppy Bug #4204: Dead slaughterfish doesn't float to water surface after loading saved game + Bug #4610: Casting a Bound Weapon spell cancels the casting animation by equipping the weapon prematurely Bug #4816: GetWeaponDrawn returns 1 before weapon is attached Bug #5057: Weapon swing sound plays at same pitch whether it hits or misses Bug #5129: Stuttering animation on Centurion Archer diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index 9999cfc3c6..544d7b299b 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -1321,7 +1321,8 @@ namespace MWMechanics { std::string weapgroup; if ((!isWerewolf || mWeaponType != ESM::Weapon::Spell) && weaptype != mWeaponType - && mUpperBodyState != UpperBodyState::Unequipping && !isStillWeapon) + && mUpperBodyState <= UpperBodyState::AttackWindUp && mUpperBodyState != UpperBodyState::Unequipping + && !isStillWeapon) { // We can not play un-equip animation if weapon changed since last update if (!weaponChanged) @@ -1363,7 +1364,7 @@ namespace MWMechanics { // Weapon is changed, no current animation (e.g. unequipping or attack). // Start equipping animation now. - if (weaptype != mWeaponType) + if (weaptype != mWeaponType && mUpperBodyState <= UpperBodyState::WeaponEquipped) { forcestateupdate = true; bool useShieldAnims = mAnimation->useShieldAnimations();