1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-10-29 03:26:38 +00:00

Further updateWeaponState cleanup

This commit is contained in:
Alexei Kotov 2022-08-09 14:10:46 +03:00
parent ea78e904a9
commit 2e112847be

View file

@ -1323,7 +1323,6 @@ bool CharacterController::updateWeaponState()
mWeaponType = weaptype;
mCurrentWeapon = weapgroup;
}
// Make sure that we disabled unequipping animation
@ -1393,9 +1392,7 @@ bool CharacterController::updateWeaponState()
spellCastResult = world->startSpellCast(mPtr);
mCanCast = spellCastResult == MWWorld::SpellCastState::Success;
if (spellid.empty())
{
if (cls.hasInventoryStore(mPtr))
if (spellid.empty() && cls.hasInventoryStore(mPtr))
{
MWWorld::InventoryStore& inv = cls.getInventoryStore(mPtr);
if (inv.getSelectedEnchantItem() != inv.end())
@ -1405,7 +1402,6 @@ bool CharacterController::updateWeaponState()
isMagicItem = true;
}
}
}
static const bool useCastingAnimations = Settings::Manager::getBool("use magic item animations", "Game");
if (isMagicItem && !useCastingAnimations)
@ -1550,7 +1546,7 @@ bool CharacterController::updateWeaponState()
}
}
// else if (mPtr != getPlayer()) use mAttackType set by AiCombat
startKey = mAttackType+" start";
startKey = mAttackType + ' ' + startKey;
stopKey = mAttackType + " min attack";
}
@ -1580,18 +1576,6 @@ bool CharacterController::updateWeaponState()
if (!animPlaying)
animPlaying = mAnimation->getInfo(mCurrentWeapon, &complete);
if (isKnockedDown())
{
if (mUpperBodyState > UpperBodyState::WeaponEquipped)
{
mUpperBodyState = UpperBodyState::WeaponEquipped;
if (mWeaponType > ESM::Weapon::None)
mAnimation->showWeapons(true);
}
if (!mCurrentWeapon.empty())
mAnimation->disable(mCurrentWeapon);
}
if (mUpperBodyState == UpperBodyState::AttackWindUp)
{
mAttackStrength = complete;