Improve vanilla consistency of weapon animations for non-bipeds (#8223, #8237)

Disable spellcast equip/unequip
Prioritize movement animations over weapon animations
master
Alexei Kotov 1 month ago
parent 4a911a647d
commit b57f4881a9

@ -202,7 +202,9 @@
Bug #8206: Moving away from storm wind origin should make you faster
Bug #8207: Using hand-to-hand while sneaking plays the critical hit sound when the target is not getting hurt
Bug #8208: The launcher's view distance option's minimum value isn't capped to Vanilla's minimum
Bug #8223: Ghosts don't move while spellcasting
Bug #8231: AGOP doesn't like NiCollisionSwitch
Bug #8237: Non-bipedal creatures should *not* use spellcast equip/unequip animations
Feature #1415: Infinite fall failsafe
Feature #2566: Handle NAM9 records for manual cell references
Feature #3501: OpenMW-CS: Instance Editing - Shortcuts for axial locking

@ -1341,10 +1341,14 @@ namespace MWMechanics
}
}
// For biped actors, blend weapon animations with lower body animations with higher priority
MWRender::Animation::AnimPriority priorityWeapon(Priority_Weapon);
MWRender::Animation::AnimPriority priorityWeapon(Priority_Default);
if (cls.isBipedal(mPtr))
{
// For bipeds, blend weapon animations with lower body animations with higher priority
// For non-bipeds, movement takes priority
priorityWeapon = Priority_Weapon;
priorityWeapon[MWRender::BoneGroup_LowerBody] = Priority_WeaponLowerBody;
}
bool forcestateupdate = false;
@ -1366,7 +1370,7 @@ namespace MWMechanics
if (!isKnockedOut() && !isKnockedDown() && !isRecovery())
{
std::string weapgroup;
if ((!isWerewolf || mWeaponType != ESM::Weapon::Spell) && weaptype != mWeaponType
if (((!isWerewolf && cls.isBipedal(mPtr)) || mWeaponType != ESM::Weapon::Spell) && weaptype != mWeaponType
&& mUpperBodyState <= UpperBodyState::AttackWindUp && mUpperBodyState != UpperBodyState::Unequipping
&& !isStillWeapon)
{
@ -1441,8 +1445,11 @@ namespace MWMechanics
"equip start", "equip stop", 0.0f, 0);
}
playBlendedAnimation(
weapgroup, priorityWeapon, equipMask, true, 1.0f, "equip start", "equip stop", 0.0f, 0);
if (weaptype != ESM::Weapon::Spell || cls.isBipedal(mPtr))
{
playBlendedAnimation(weapgroup, priorityWeapon, equipMask, true, 1.0f, "equip start",
"equip stop", 0.0f, 0);
}
mUpperBodyState = UpperBodyState::Equipping;
// If we do not have the "equip attach" key, show weapon manually.
@ -1797,11 +1804,7 @@ namespace MWMechanics
if (animPlaying)
mAnimation->disable(mCurrentWeapon);
MWRender::Animation::AnimPriority priorityFollow(priorityWeapon);
// Follow animations have lower priority than movement for non-biped creatures, logic be damned
if (!cls.isBipedal(mPtr))
priorityFollow = Priority_Default;
playBlendedAnimation(mCurrentWeapon, priorityFollow, MWRender::BlendMask_All, false, weapSpeed,
playBlendedAnimation(mCurrentWeapon, priorityWeapon, MWRender::BlendMask_All, false, weapSpeed,
mAttackType + ' ' + start, mAttackType + ' ' + stop, 0.0f, 0);
mUpperBodyState = UpperBodyState::AttackEnd;

Loading…
Cancel
Save