diff --git a/code/3DSLoader.cpp b/code/3DSLoader.cpp index f6ade56a3..7c28f1f81 100644 --- a/code/3DSLoader.cpp +++ b/code/3DSLoader.cpp @@ -186,15 +186,14 @@ void Discreet3DSImporter::InternReadFile( const std::string& pFile, // internal verbose representation. Finally compute normal // vectors from the smoothing groups we read from the // file. - for (std::vector::iterator i = mScene->mMeshes.begin(), - end = mScene->mMeshes.end(); i != end;++i) { - if ((*i).mFaces.size() > 0 && (*i).mPositions.size() == 0) { + for (auto &mesh : mScene->mMeshes) { + if (mesh.mFaces.size() > 0 && mesh.mPositions.size() == 0) { delete mScene; throw DeadlyImportError("3DS file contains faces but no vertices: " + pFile); } - CheckIndices(*i); - MakeUnique (*i); - ComputeNormalsWithSmoothingsGroups(*i); + CheckIndices(mesh); + MakeUnique (mesh); + ComputeNormalsWithSmoothingsGroups(mesh); } // Replace all occurrences of the default material with a