- Fixed a crash when loading OBJ models with faces without normals

This commit is contained in:
biwa 2019-08-08 12:17:49 +02:00
parent d2452abe5c
commit c00a8995aa

View file

@ -1653,12 +1653,12 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
face.Add(int.Parse(vertexdata[0], CultureInfo.InvariantCulture) - 1);
if (vertexdata.Length >= 1 && vertexdata[1] != "")
if (vertexdata.Length > 1 && vertexdata[1] != "")
texcoords.Add(int.Parse(vertexdata[1], CultureInfo.InvariantCulture) - 1);
else
texcoords.Add(-1);
if (vertexdata.Length >= 2 && vertexdata[2] != "")
if (vertexdata.Length > 2 && vertexdata[2] != "")
normals.Add(int.Parse(vertexdata[2], CultureInfo.InvariantCulture) - 1);
else
normals.Add(-1);