diff --git a/src/raw/RawModel.cpp b/src/raw/RawModel.cpp index 2a7fe12..2c8b4d1 100644 --- a/src/raw/RawModel.cpp +++ b/src/raw/RawModel.cpp @@ -100,7 +100,9 @@ int RawModel::AddTexture( return -1; } for (size_t i = 0; i < textures.size(); i++) { - if (StringUtils::CompareNoCase(textures[i].name, name) == 0 && textures[i].usage == usage) { + // 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) { return (int)i; } }