From 45847193629e2f1f78ea0cffb95daf1523abdf7a Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 26 May 2024 18:39:14 +0200 Subject: [PATCH] Update ObjFileParser.cpp (#5598) Ensure not checking empty strings --- code/AssetLib/Obj/ObjFileParser.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/code/AssetLib/Obj/ObjFileParser.cpp b/code/AssetLib/Obj/ObjFileParser.cpp index c0f1fc483..ed41f2273 100644 --- a/code/AssetLib/Obj/ObjFileParser.cpp +++ b/code/AssetLib/Obj/ObjFileParser.cpp @@ -582,10 +582,12 @@ void ObjFileParser::getMaterialDesc() { skip = true; } - // If the current mesh has the same material, we simply ignore that 'usemtl' command + // If the current mesh has the same material, we will ignore that 'usemtl' command // There is no need to create another object or even mesh here - if (m_pModel->mCurrentMaterial && m_pModel->mCurrentMaterial->MaterialName == aiString(strName)) { - skip = true; + if (!skip) { + if (m_pModel->mCurrentMaterial && m_pModel->mCurrentMaterial->MaterialName == aiString(strName)) { + skip = true; + } } if (!skip) {