1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-06-20 12:11:32 +00:00

Merge branch 'attackanimationsareforfalsegods' into 'master'

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

Closes #8237 and #8223

See merge request OpenMW/openmw!4462
This commit is contained in:
psi29a 2024-11-23 19:31:29 +00:00
commit 97522c22ae
2 changed files with 15 additions and 10 deletions

View file

@ -202,7 +202,9 @@
Bug #8206: Moving away from storm wind origin should make you faster 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 #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 #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 #8231: AGOP doesn't like NiCollisionSwitch
Bug #8237: Non-bipedal creatures should *not* use spellcast equip/unequip animations
Feature #1415: Infinite fall failsafe Feature #1415: Infinite fall failsafe
Feature #2566: Handle NAM9 records for manual cell references Feature #2566: Handle NAM9 records for manual cell references
Feature #3501: OpenMW-CS: Instance Editing - Shortcuts for axial locking Feature #3501: OpenMW-CS: Instance Editing - Shortcuts for axial locking

View file

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