From 7f7918957a23c69f132113e7d46b07ef90dc77ed Mon Sep 17 00:00:00 2001 From: PascalGilbraith <55348643+PascalGilbraith@users.noreply.github.com> Date: Sun, 15 Sep 2019 13:05:04 +0100 Subject: [PATCH] Issue 2603 Normal face indices added to end of already resized vector, so normal faces did not match position faces. Use vector index rather than push. --- code/X/XFileParser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/X/XFileParser.cpp b/code/X/XFileParser.cpp index 08d3c88da..8fcf87cf6 100644 --- a/code/X/XFileParser.cpp +++ b/code/X/XFileParser.cpp @@ -596,11 +596,11 @@ void XFileParser::ParseDataObjectMeshNormals( Mesh* pMesh) // do not crah when no face definitions are there if (numFaces > 0) { // normal face creation - pMesh->mNormFaces.resize( pMesh->mNormFaces.size() + numFaces ); + pMesh->mNormFaces.resize( numFaces ); for( unsigned int a = 0; a < numFaces; ++a ) { unsigned int numIndices = ReadInt(); - pMesh->mNormFaces.push_back( Face() ); - Face& face = pMesh->mNormFaces.back(); + pMesh->mNormFaces[a] = Face(); + Face& face = pMesh->mNormFaces[a]; for( unsigned int b = 0; b < numIndices; ++b ) { face.mIndices.push_back( ReadInt()); }