diff --git a/src/raw/RawModel.cpp b/src/raw/RawModel.cpp index 2c8b4d1..38b5fc7 100644 --- a/src/raw/RawModel.cpp +++ b/src/raw/RawModel.cpp @@ -101,8 +101,9 @@ int RawModel::AddTexture( } for (size_t i = 0; i < textures.size(); i++) { // we allocate the struct even if the implementing image file is missing - if (StringUtils::CompareNoCase(textures[i].fileLocation, fileLocation) == 0 && - StringUtils::CompareNoCase(textures[i].name, name) == 0 && textures[i].usage == usage) { + if (textures[i].usage == usage && + StringUtils::CompareNoCase(textures[i].fileLocation, fileLocation) == 0 && + StringUtils::CompareNoCase(textures[i].name, name) == 0) { return (int)i; } }