1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-06-19 16:11:34 +00:00

Allow equip attach/detach keys to coincide with the start key

This commit is contained in:
Alexei Kotov 2025-05-22 04:53:34 +03:00
parent b7a48e1d78
commit 9387f50f77

View file

@ -1388,6 +1388,7 @@ namespace MWMechanics
// Note: we do not disable unequipping animation automatically to avoid body desync
weapgroup = getWeaponAnimation(mWeaponType);
int unequipMask = MWRender::BlendMask_All;
mUpperBodyState = UpperBodyState::Unequipping;
bool useShieldAnims = mAnimation->useShieldAnimations();
if (useShieldAnims && mWeaponType != ESM::Weapon::HandToHand && mWeaponType != ESM::Weapon::Spell
&& !(mWeaponType == ESM::Weapon::None && weaptype == ESM::Weapon::Spell))
@ -1402,7 +1403,6 @@ namespace MWMechanics
mAnimation->disable(weapgroup);
playBlendedAnimation(
weapgroup, priorityWeapon, unequipMask, false, 1.0f, "unequip start", "unequip stop", 0.0f, 0);
mUpperBodyState = UpperBodyState::Unequipping;
mAnimation->detachArrow();
@ -1447,6 +1447,7 @@ namespace MWMechanics
{
mAnimation->showWeapons(false);
int equipMask = MWRender::BlendMask_All;
mUpperBodyState = UpperBodyState::Equipping;
if (useShieldAnims && weaptype != ESM::Weapon::Spell)
{
equipMask = equipMask | ~MWRender::BlendMask_LeftArm;
@ -1459,7 +1460,6 @@ namespace MWMechanics
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.
if (weaptype != ESM::Weapon::Spell