Don't return a random anonymous node from getArrowBone when the current weapon doesn't fire arrows.

pull/3227/head
AnyOldName3 3 years ago
parent 699c1db1d8
commit a6c9c9d1f8

@ -232,6 +232,8 @@ osg::Group *CreatureWeaponAnimation::getArrowBone()
int type = weapon->get<ESM::Weapon>()->mBase->mData.mType;
int ammoType = MWMechanics::getWeaponType(type)->mAmmoType;
if (ammoType == ESM::Weapon::None)
return nullptr;
// Try to find and attachment bone in actor's skeleton, otherwise fall back to the ArrowBone in weapon's mesh
osg::Group* bone = getBoneByName(MWMechanics::getWeaponType(ammoType)->mAttachBone);

@ -1034,6 +1034,8 @@ osg::Group* NpcAnimation::getArrowBone()
int type = weapon->get<ESM::Weapon>()->mBase->mData.mType;
int ammoType = MWMechanics::getWeaponType(type)->mAmmoType;
if (ammoType == ESM::Weapon::None)
return nullptr;
// Try to find and attachment bone in actor's skeleton, otherwise fall back to the ArrowBone in weapon's mesh
osg::Group* bone = getBoneByName(MWMechanics::getWeaponType(ammoType)->mAttachBone);

Loading…
Cancel
Save