mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-03 12:45:38 +00:00
Don't allow non-bipedal actors to play hand-to-hand animations
This commit is contained in:
parent
5ebcd37da1
commit
020e0b2ea5
1 changed files with 7 additions and 5 deletions
|
@ -435,6 +435,8 @@ std::string CharacterController::getWeaponAnimation(int weaponType) const
|
|||
else if (isRealWeapon)
|
||||
weaponGroup = oneHandFallback;
|
||||
}
|
||||
else if (weaponType == ESM::Weapon::HandToHand && !mPtr.getClass().isBipedal(mPtr))
|
||||
return "attack1";
|
||||
|
||||
return weaponGroup;
|
||||
}
|
||||
|
@ -1293,7 +1295,7 @@ bool CharacterController::updateState(CharacterState& idle)
|
|||
}
|
||||
|
||||
mWeaponType = weaptype;
|
||||
mCurrentWeapon = getWeaponAnimation(mWeaponType);
|
||||
mCurrentWeapon = weapgroup;
|
||||
|
||||
if(!upSoundId.empty() && !isStillWeapon)
|
||||
{
|
||||
|
@ -1376,11 +1378,7 @@ bool CharacterController::updateState(CharacterState& idle)
|
|||
{
|
||||
mCurrentWeapon = chooseRandomAttackAnimation();
|
||||
if (!mPtr.getClass().hasInventoryStore(mPtr))
|
||||
{
|
||||
mAttackStrength = std::min(1.f, 0.1f + Misc::Rng::rollClosedProbability());
|
||||
if (mWeaponType == ESM::Weapon::HandToHand)
|
||||
playSwishSound(0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
if(mWeaponType == ESM::Weapon::Spell)
|
||||
|
@ -1561,7 +1559,11 @@ bool CharacterController::updateState(CharacterState& idle)
|
|||
weapSpeed, startKey, stopKey,
|
||||
0.0f, 0);
|
||||
if(mAnimation->getCurrentTime(mCurrentWeapon) != -1.f)
|
||||
{
|
||||
mUpperBodyState = UpperCharState_StartToMinAttack;
|
||||
if (mWeaponType == ESM::Weapon::HandToHand && !mPtr.getClass().isBipedal(mPtr))
|
||||
playSwishSound(0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue