mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-31 17:45:35 +00:00
Don't return a random anonymous node from getArrowBone when the current weapon doesn't fire arrows.
This commit is contained in:
parent
699c1db1d8
commit
a6c9c9d1f8
2 changed files with 4 additions and 0 deletions
|
@ -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…
Reference in a new issue