Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This PR solves a crash with Robert's bodies logged on your bugtracker. #3095

Merged
merged 15 commits into from
Sep 9, 2021
Prev Previous commit
Next Next commit
npcanimation.cpp [ci skip]
  • Loading branch information
bosvensson1 committed Sep 5, 2021
commit 6ce9b3399d6403ddb24a412ee7fc6b455a619868
4 changes: 2 additions & 2 deletions apps/openmw/mwrender/npcanimation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -714,14 +714,14 @@ void NpcAnimation::updateParts()

PartHolderPtr NpcAnimation::insertBoundedPart(const std::string& model, const std::string& bonename, const std::string& bonefilter, bool enchantedGlow, osg::Vec4f* glowColor)
{
osg::ref_ptr<osg::Node> instance = mResourceSystem->getSceneManager()->getInstance(model);
osg::ref_ptr<const osg::Node> template = mResourceSystem->getSceneManager()->getTemplate(model);

const NodeMap& nodeMap = getNodeMap();
NodeMap::const_iterator found = nodeMap.find(Misc::StringUtils::lowerCase(bonename));
if (found == nodeMap.end())
throw std::runtime_error("Can't find attachment node " + bonename);

osg::ref_ptr<osg::Node> attached = SceneUtil::attach(instance, mObjectRoot, bonefilter, found->second);
osg::ref_ptr<osg::Node> attached = SceneUtil::attach(template, mObjectRoot, bonefilter, found->second);
if (enchantedGlow)
mGlowUpdater = SceneUtil::addEnchantedGlow(attached, mResourceSystem, *glowColor);

Expand Down