summaryrefslogtreecommitdiff
path: root/src/content_cao.cpp
diff options
context:
space:
mode:
authorsapier <Sapier at GMX dot net>2014-06-27 20:42:20 +0200
committersapier <Sapier at GMX dot net>2014-06-27 20:42:20 +0200
commitf383766dbf636c47d5d115b3f6e9aa3bcb54cfa4 (patch)
tree1e4abd8a13ec1801bc51830729a02f40862f6605 /src/content_cao.cpp
parented2c8ba9c5d1a80cefe20bd75660536d9a0dd0f5 (diff)
downloadminetest-f383766dbf636c47d5d115b3f6e9aa3bcb54cfa4.tar.gz
minetest-f383766dbf636c47d5d115b3f6e9aa3bcb54cfa4.tar.bz2
minetest-f383766dbf636c47d5d115b3f6e9aa3bcb54cfa4.zip
Fix GenericCAO fails to grabing member animated mesh node to prevent it do be deleted to early
Diffstat (limited to 'src/content_cao.cpp')
-rw-r--r--src/content_cao.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/content_cao.cpp b/src/content_cao.cpp
index bd90e96a5..aa999b3af 100644
--- a/src/content_cao.cpp
+++ b/src/content_cao.cpp
@@ -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)
@@ -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,