From ee450471fdf4dbb276bbf6f3f7e7662237d84652 Mon Sep 17 00:00:00 2001 From: scrawl Date: Tue, 13 Oct 2015 17:55:57 +0200 Subject: [PATCH] Disable head controller for non-bipedal creatures (Fixes #2843, Fixes #2966) --- apps/openmw/mwrender/animation.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index 37ec4c213..a0704a59a 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -1320,13 +1320,16 @@ namespace MWRender { mHeadController = NULL; - NodeMap::iterator found = mNodeMap.find("bip01 head"); - if (found != mNodeMap.end() && dynamic_cast(found->second.get())) + if (mPtr.getClass().isBipedal(mPtr)) { - osg::Node* node = found->second; - mHeadController = new RotateController(mObjectRoot.get()); - node->addUpdateCallback(mHeadController); - mActiveControllers.insert(std::make_pair(node, mHeadController)); + NodeMap::iterator found = mNodeMap.find("bip01 head"); + if (found != mNodeMap.end() && dynamic_cast(found->second.get())) + { + osg::Node* node = found->second; + mHeadController = new RotateController(mObjectRoot.get()); + node->addUpdateCallback(mHeadController); + mActiveControllers.insert(std::make_pair(node, mHeadController)); + } } }