Skip to content
Snippets Groups Projects
Commit 3da26ee8 authored by David Parks's avatar David Parks
Browse files

SL-20321 Fix for missing "has_te" check (thanks Henri)

parent 813acc39
No related branches found
No related tags found
No related merge requests found
...@@ -360,8 +360,8 @@ void LLGLTFMaterialList::applyOverrideMessage(LLMessageSystem* msg, const std::s ...@@ -360,8 +360,8 @@ void LLGLTFMaterialList::applyOverrideMessage(LLMessageSystem* msg, const std::s
constexpr U32 MAX_TES = 45; constexpr U32 MAX_TES = 45;
bool has_te[MAX_TES] = { false }; bool has_te[MAX_TES] = { false };
if (tes.isArray()) if (tes.isArray()) // NOTE: if no "te" array exists, this is a malformed message (null out all overrides will come in as an empty te array)
{ {
LLGLTFOverrideCacheEntry cache; LLGLTFOverrideCacheEntry cache;
cache.mLocalId = local_id; cache.mLocalId = local_id;
cache.mObjectId = id; cache.mObjectId = id;
...@@ -395,7 +395,7 @@ void LLGLTFMaterialList::applyOverrideMessage(LLMessageSystem* msg, const std::s ...@@ -395,7 +395,7 @@ void LLGLTFMaterialList::applyOverrideMessage(LLMessageSystem* msg, const std::s
for (U32 i = 0; i < count; ++i) for (U32 i = 0; i < count; ++i)
{ {
LLTextureEntry* te = obj->getTE(i); LLTextureEntry* te = obj->getTE(i);
if (te && te->getGLTFMaterialOverride()) if (!has_te[i] && te && te->getGLTFMaterialOverride())
{ {
obj->setTEGLTFMaterialOverride(i, nullptr); obj->setTEGLTFMaterialOverride(i, nullptr);
handle_gltf_override_message.doSelectionCallbacks(id, i); handle_gltf_override_message.doSelectionCallbacks(id, i);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment