mirror of
https://github.com/OpenMW/openmw.git
synced 2025-05-30 08:11:32 +00:00
Further updateWeaponState cleanup
This commit is contained in:
parent
ea78e904a9
commit
2e112847be
1 changed files with 8 additions and 24 deletions
|
@ -1323,7 +1323,6 @@ bool CharacterController::updateWeaponState()
|
|||
|
||||
mWeaponType = weaptype;
|
||||
mCurrentWeapon = weapgroup;
|
||||
|
||||
}
|
||||
|
||||
// Make sure that we disabled unequipping animation
|
||||
|
@ -1393,17 +1392,14 @@ bool CharacterController::updateWeaponState()
|
|||
spellCastResult = world->startSpellCast(mPtr);
|
||||
mCanCast = spellCastResult == MWWorld::SpellCastState::Success;
|
||||
|
||||
if (spellid.empty())
|
||||
if (spellid.empty() && cls.hasInventoryStore(mPtr))
|
||||
{
|
||||
if (cls.hasInventoryStore(mPtr))
|
||||
MWWorld::InventoryStore& inv = cls.getInventoryStore(mPtr);
|
||||
if (inv.getSelectedEnchantItem() != inv.end())
|
||||
{
|
||||
MWWorld::InventoryStore& inv = cls.getInventoryStore(mPtr);
|
||||
if (inv.getSelectedEnchantItem() != inv.end())
|
||||
{
|
||||
const MWWorld::Ptr& enchantItem = *inv.getSelectedEnchantItem();
|
||||
spellid = enchantItem.getClass().getEnchantment(enchantItem);
|
||||
isMagicItem = true;
|
||||
}
|
||||
const MWWorld::Ptr& enchantItem = *inv.getSelectedEnchantItem();
|
||||
spellid = enchantItem.getClass().getEnchantment(enchantItem);
|
||||
isMagicItem = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1550,8 +1546,8 @@ bool CharacterController::updateWeaponState()
|
|||
}
|
||||
}
|
||||
// else if (mPtr != getPlayer()) use mAttackType set by AiCombat
|
||||
startKey = mAttackType+" start";
|
||||
stopKey = mAttackType+" min attack";
|
||||
startKey = mAttackType + ' ' + startKey;
|
||||
stopKey = mAttackType + " min attack";
|
||||
}
|
||||
|
||||
mAnimation->play(mCurrentWeapon, priorityWeapon,
|
||||
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue