Browse Source

return 0 if a polygon texture is accessed that does not exists

Kolja Strohm 8 months ago
parent
commit
a58b3b16f9
1 changed files with 1 additions and 0 deletions
  1. 1 0
      Model3D.cpp

+ 1 - 0
Model3D.cpp

@@ -709,6 +709,7 @@ void Model3DTextur::setPolygonTextur(int pI, Textur* txt)
 //  i: Der Index des Polygons
 Textur* Model3DTextur::zPolygonTextur(int i) const
 {
+    if (i >= textureCount) return 0;
     return textures[i];
 }