summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCosmic Linden <cosmic@lindenlab.com>2023-11-03 09:57:19 -0700
committerCosmic Linden <cosmic@lindenlab.com>2023-11-09 13:54:41 -0800
commit2d69611c470e8ca0f85f6ad5857799ca2536f193 (patch)
tree36e40328788f79426cda41ef36416550c5106896
parent711354c2f526421b7cd2918f584731624a9995e5 (diff)
SL-20553: Fix save material to inventory not working with new agent-based permissions
-rw-r--r--indra/newview/llmaterialeditor.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp
index bae4afb7e6..cc7e69d60c 100644
--- a/indra/newview/llmaterialeditor.cpp
+++ b/indra/newview/llmaterialeditor.cpp
@@ -1852,6 +1852,10 @@ bool can_use_objects_material(LLSelectedTEGetMatData& func, const std::vector<Pe
llassert(func.mIsOverride);
LLSelectMgr::getInstance()->getSelection()->applyToTEs(&func, true /*first applicable*/);
+ if (item_source == ItemSource::AGENT)
+ {
+ func.mObjectId = LLUUID::null;
+ }
LLViewerObject* selected_object = func.mObject;
if (!selected_object)
{
@@ -1879,11 +1883,12 @@ bool can_use_objects_material(LLSelectedTEGetMatData& func, const std::vector<Pe
LLAssetIDMatchesWithPerms item_has_perms(func.mMaterialId, ops);
if (item_source == ItemSource::OBJECT)
{
- item_out = selected_object->getInventoryItemByAsset(func.mMaterialId);
- if (item_out && !item_has_perms(nullptr, item_out))
+ LLViewerInventoryItem* item = selected_object->getInventoryItemByAsset(func.mMaterialId);
+ if (item && !item_has_perms(nullptr, item))
{
return false;
}
+ item_out = item;
}
else
{
@@ -2118,8 +2123,9 @@ void LLMaterialEditor::saveObjectsMaterialAs(const LLGLTFMaterial* render_materi
}
else
{
- if (item_id.notNull())
+ if (item_id.notNull() && object_id.notNull())
{
+ llassert(false); // *TODO: Remove this code path if unused
// Copy existing item from object inventory, and create new composite asset on top of it
LLNotificationsUtil::add("SaveMaterialAs", args, payload, boost::bind(&LLMaterialEditor::onCopyObjectsMaterialAsMsgCallback, _1, _2, permissions, object_id, item_id));
}