Преглед на файлове

Update ObjFileParser.cpp (#5598)

Ensure not checking empty strings
Kim Kulling преди 1 година
родител
ревизия
4584719362
променени са 1 файла, в които са добавени 5 реда и са изтрити 3 реда
  1. 5 3
      code/AssetLib/Obj/ObjFileParser.cpp

+ 5 - 3
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) {