Add improved error checks
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10562 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
@@ -538,7 +538,13 @@ scene::IAnimatedMesh *IrrDriver::getAnimatedMesh(const std::string &filename)
|
||||
*/
|
||||
scene::IMesh *IrrDriver::getMesh(const std::string &filename)
|
||||
{
|
||||
return getAnimatedMesh(filename)->getMesh(0);
|
||||
IAnimatedMesh* am = getAnimatedMesh(filename);
|
||||
if (am == NULL)
|
||||
{
|
||||
fprintf(stderr, "ERROR: cannot load mesh <%s>\n", filename.c_str());
|
||||
return NULL;
|
||||
}
|
||||
return am->getMesh(0);
|
||||
} // getMesh
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user