Commit e12988e7 authored by hybrid's avatar hybrid

Fix collada loader bug, which tried to access non-existing textures. Found by Sylence.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3416 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 3a66a00b
......@@ -1568,7 +1568,8 @@ const SColladaMaterial* CColladaFileLoader::findMaterial(const core::stringc& ma
{
// found the effect, instantiate by copying into the material
Materials[mat].Mat = Effects[effect].Mat;
Materials[mat].Mat.setTexture(0, getTextureFromImage(Effects[effect].Textures[0]));
if (Effects[effect].Textures.size())
Materials[mat].Mat.setTexture(0, getTextureFromImage(Effects[effect].Textures[0]));
Materials[mat].Transparency = Effects[effect].Transparency;
// and indicate the material is instantiated by removing the effect ref
Materials[mat].InstanceEffectId = "";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment