Fixed crash by moving scene_node->setName AFTER checking that scene_node is not null

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7947 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2011-03-16 15:39:46 +00:00
parent 5a9a09a59e
commit 5d56ff3778

View File

@ -865,16 +865,18 @@ void Track::createWater(const XMLNode &node)
scene_node = irr_driver->addMesh(mesh);
}
#ifdef DEBUG
std::string debug_name = model_name+"(water node)";
scene_node->setName(debug_name.c_str());
#endif
if(!mesh || !scene_node)
{
fprintf(stderr, "Warning: Water model '%s' in '%s' not found, ignored.\n",
node.getName().c_str(), model_name.c_str());
return;
}
#ifdef DEBUG
std::string debug_name = model_name+"(water node)";
scene_node->setName(debug_name.c_str());
#endif
mesh->grab();
m_all_meshes.push_back(mesh);