mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-21 19:41:35 +00:00
Randomize attacks for non-bipedal creatures with Weapon flag
This commit is contained in:
parent
0440c11ccd
commit
929d78d6a3
1 changed files with 8 additions and 0 deletions
|
@ -1399,6 +1399,14 @@ bool CharacterController::updateWeaponState()
|
||||||
MWBase::Environment::get().getWorld()->breakInvisibility(mPtr);
|
MWBase::Environment::get().getWorld()->breakInvisibility(mPtr);
|
||||||
mAttackStrength = 0;
|
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)
|
if(mWeaponType == WeapType_Spell)
|
||||||
{
|
{
|
||||||
// Unset casting flag, otherwise pressing the mouse button down would
|
// Unset casting flag, otherwise pressing the mouse button down would
|
||||||
|
|
Loading…
Reference in a new issue