1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

Create new instance of mesh every time it's required (Solves #703)

This commit is contained in:
Perttu Ahola 2014-01-06 13:24:06 +02:00
parent 86c616a545
commit d76957ee22
4 changed files with 44 additions and 24 deletions

View file

@ -957,10 +957,11 @@ public:
}
else if(m_prop.visual == "mesh"){
infostream<<"GenericCAO::addToScene(): mesh"<<std::endl;
scene::IAnimatedMesh *mesh = smgr->getMesh(m_prop.mesh.c_str());
scene::IAnimatedMesh *mesh = m_gamedef->getMesh(m_prop.mesh);
if(mesh)
{
m_animated_meshnode = smgr->addAnimatedMeshSceneNode(mesh, NULL);
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,
m_prop.visual_size.Y,