diff --git a/apps/openmw/mwrender/actoranimation.cpp b/apps/openmw/mwrender/actoranimation.cpp index 9d68bf9bbd5..f4bafdb48b7 100644 --- a/apps/openmw/mwrender/actoranimation.cpp +++ b/apps/openmw/mwrender/actoranimation.cpp @@ -365,10 +365,17 @@ namespace MWRender } mScabbard = attachMesh(scabbardName, boneName); - if (mScabbard && weaponClass == ESM::WeaponType::Ranged) + + if (!mScabbard || !mScabbard->getNode()) + return; + + if (weaponClass == ESM::WeaponType::Ranged) resetControllers(mScabbard->getNode()); - osg::Group* weaponNode = getBoneByName("Bip01 Weapon"); + SceneUtil::FindByNameVisitor findVisitor("Bip01 Weapon"); + mScabbard->getNode()->accept(findVisitor); + osg::Group* weaponNode = findVisitor.mFoundNode; + if (!weaponNode) return;