1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-01 06:15:35 +00:00

Randomize attacks for non-bipedal creatures with Weapon flag

This commit is contained in:
Andrei Kortunov 2018-08-20 21:52:05 +04:00
parent 0440c11ccd
commit 929d78d6a3

View file

@ -1399,6 +1399,14 @@ bool CharacterController::updateWeaponState()
MWBase::Environment::get().getWorld()->breakInvisibility(mPtr);
mAttackStrength = 0;
// Randomize attacks for non-bipedal creatures with Weapon flag
if (mPtr.getClass().getTypeName() == typeid(ESM::Creature).name() &&
!mPtr.getClass().isBipedal(mPtr) &&
(!mAnimation->hasAnimation(mCurrentWeapon) || isRandomAttackAnimation(mCurrentWeapon)))
{
mCurrentWeapon = chooseRandomAttackAnimation();
}
if(mWeaponType == WeapType_Spell)
{
// Unset casting flag, otherwise pressing the mouse button down would