From 1c24cba46a266499b136e55ce5c351f0eb7c0acd Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 22 Feb 2016 15:13:31 +0100 Subject: [PATCH] Don't use multiple parental node paths. --- apps/opencs/view/render/object.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/opencs/view/render/object.cpp b/apps/opencs/view/render/object.cpp index 1833d7340..0f135459b 100644 --- a/apps/opencs/view/render/object.cpp +++ b/apps/opencs/view/render/object.cpp @@ -167,7 +167,6 @@ CSVRender::Object::Object (CSMWorld::Data& data, osg::Group* parentNode, mBaseNode->addCullCallback(new SceneUtil::LightListCallback); mOutline = new osgFX::Scribe; - mOutline->addChild(mBaseNode); mBaseNode->setUserData(new ObjectTag(this)); @@ -202,10 +201,14 @@ void CSVRender::Object::setSelected(bool selected) { mSelected = selected; + mOutline->removeChild(mBaseNode); mRootNode->removeChild(mOutline); mRootNode->removeChild(mBaseNode); if (selected) + { + mOutline->addChild(mBaseNode); mRootNode->addChild(mOutline); + } else mRootNode->addChild(mBaseNode); }