forked from mirror/openmw-tes3mp
sceneutil/attach: inherit the UserDataContainer to avoid the resource cache from being cleared incorrectly
This commit is contained in:
parent
17125e6c4d
commit
8f71b65d38
1 changed files with 4 additions and 0 deletions
|
@ -87,6 +87,8 @@ namespace SceneUtil
|
|||
{
|
||||
osg::ref_ptr<osg::Group> handle = new osg::Group;
|
||||
|
||||
osg::UserDataContainer* udc = toAttach->getUserDataContainer();
|
||||
|
||||
CopyRigVisitor copyVisitor(handle, filter);
|
||||
toAttach->accept(copyVisitor);
|
||||
copyVisitor.doCopy();
|
||||
|
@ -96,11 +98,13 @@ namespace SceneUtil
|
|||
osg::ref_ptr<osg::Node> newHandle = handle->getChild(0);
|
||||
handle->removeChild(newHandle);
|
||||
master->asGroup()->addChild(newHandle);
|
||||
newHandle->setUserDataContainer(udc);
|
||||
return newHandle;
|
||||
}
|
||||
else
|
||||
{
|
||||
master->asGroup()->addChild(handle);
|
||||
handle->setUserDataContainer(udc);
|
||||
return handle;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue