Fixed crash loading textured parts.

This commit is contained in:
Leonardo Zide 2019-06-02 09:39:12 -07:00
parent b8c2074c93
commit 7001cdf11d

View file

@ -1505,11 +1505,11 @@ lcMesh* lcPiecesLibrary::CreateMesh(PieceInfo* Info, lcLibraryMeshData& MeshData
{ {
for (const lcLibraryMeshVertex& SrcVertex : MeshData.mVertices[MeshDataIdx]) for (const lcLibraryMeshVertex& SrcVertex : MeshData.mVertices[MeshDataIdx])
{ {
lcVertex& DstVertex = *DstVerts++;
if ((SrcVertex.Usage & LC_LIBRARY_VERTEX_UNTEXTURED) == 0) if ((SrcVertex.Usage & LC_LIBRARY_VERTEX_UNTEXTURED) == 0)
continue; continue;
lcVertex& DstVertex = *DstVerts++;
DstVertex.Position = lcVector3LDrawToLeoCAD(SrcVertex.Position); DstVertex.Position = lcVector3LDrawToLeoCAD(SrcVertex.Position);
DstVertex.Normal = lcPackNormal(lcVector3LDrawToLeoCAD(SrcVertex.Normal)); DstVertex.Normal = lcPackNormal(lcVector3LDrawToLeoCAD(SrcVertex.Normal));
} }