Skip to content

Commit e391b0c

Browse files
committed
Merge branch 'thisishowkingcrimsonworksmaybe' into 'master'
Skip thrown weapon -> H2H idle transition at the end of an attack (#8924) Closes #8924 See merge request OpenMW/openmw!5107
2 parents 9c3221e + ba0d7bc commit e391b0c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

apps/openmw/mwmechanics/character.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,6 +1370,8 @@ namespace MWMechanics
13701370

13711371
// If the current weapon type was changed in the middle of attack (e.g. by Equip console command or when bound
13721372
// spell expires), we should force actor to the "weapon equipped" state, interrupt attack and update animations.
1373+
// Morrowind does this at the end of the attack (see #4646 and PR 1972).
1374+
// If we decide to cope with the resulting problems, the thrown weapon->H2H case below should be extended.
13731375
if (isStillWeapon && mWeaponType != weaptype && mUpperBodyState > UpperBodyState::WeaponEquipped)
13741376
{
13751377
forcestateupdate = true;
@@ -1847,6 +1849,20 @@ namespace MWMechanics
18471849
if (animPlaying)
18481850
mAnimation->disable(mCurrentWeapon);
18491851

1852+
// Skip Thrown->H2H idle transition (e.g., if we've run out of ammo)
1853+
// In Morrowind this isn't actually specific to this transition
1854+
// See the weapon->weapon mid-attack skip logic above
1855+
if (mUpperBodyState == UpperBodyState::AttackEnd)
1856+
{
1857+
if (weapclass == ESM::WeaponType::Thrown && weaptype == ESM::Weapon::HandToHand)
1858+
{
1859+
forcestateupdate = true;
1860+
mWeaponType = weaptype;
1861+
mCurrentWeapon = getWeaponAnimation(mWeaponType);
1862+
mAnimation->showWeapons(false);
1863+
}
1864+
}
1865+
18501866
mUpperBodyState = UpperBodyState::WeaponEquipped;
18511867
}
18521868
else if (mUpperBodyState == UpperBodyState::Unequipping)

0 commit comments

Comments
 (0)