Skip to content

Commit

Permalink
Fix GenericCAO fails to grabing member animated mesh node to prevent …
Browse files Browse the repository at this point in the history
…it do be deleted to early
  • Loading branch information
sapier authored and sapier committed Jun 27, 2014
1 parent ed2c8ba commit f383766
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/content_cao.cpp
Expand Up @@ -756,6 +756,7 @@ void GenericCAO::removeFromScene(bool permanent)
if(m_animated_meshnode)
{
m_animated_meshnode->remove();
m_animated_meshnode->drop();
m_animated_meshnode = NULL;
}
if(m_spritenode)
Expand Down Expand Up @@ -879,6 +880,7 @@ void GenericCAO::addToScene(scene::ISceneManager *smgr, ITextureSource *tsrc,
if(mesh)
{
m_animated_meshnode = smgr->addAnimatedMeshSceneNode(mesh, NULL);
m_animated_meshnode->grab();
mesh->drop(); // The scene node took hold of it
m_animated_meshnode->animateJoints(); // Needed for some animations
m_animated_meshnode->setScale(v3f(m_prop.visual_size.X,
Expand Down

0 comments on commit f383766

Please sign in to comment.