diff options
author | Cosmic Linden <cosmic@lindenlab.com> | 2023-07-21 13:01:11 -0700 |
---|---|---|
committer | Cosmic Linden <cosmic@lindenlab.com> | 2023-08-11 16:30:49 -0700 |
commit | e7e565dc6e7e0c666132ffffa4798b2cfc00d6a4 (patch) | |
tree | 0c142c10d50be9a52dba2f73f3b26865e829be24 /indra/newview/lltooldraganddrop.cpp | |
parent | 9be8103142dc16b58dcf930d5d1f70f49272837f (diff) |
SL-20024: Put material in object inventory when material is no-modify or no-transfer
Diffstat (limited to 'indra/newview/lltooldraganddrop.cpp')
-rw-r--r-- | indra/newview/lltooldraganddrop.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index dd5f607b04..23a6634154 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -1042,6 +1042,26 @@ BOOL LLToolDragAndDrop::handleDropMaterialProtections(LLViewerObject* hit_obj, // we should return false here. This will requre a separate listener // since without listener, we have no way to receive update } + else if (LLAssetType::AT_MATERIAL == new_item->getType() && + !item->getPermissions().allowOperationBy(PERM_MODIFY, gAgent.getID())) + { + // Check that we can add the material as inventory to the object + if (willObjectAcceptInventory(hit_obj,item) < ACCEPT_YES_COPY_SINGLE ) + { + return FALSE; + } + // *FIX: may want to make sure agent can paint hit_obj. + + // Add the material item to the target object's inventory. + hit_obj->updateMaterialInventory(new_item, TASK_INVENTORY_ITEM_KEY, true); + + // Force the object to update and refetch its inventory so it has this material. + hit_obj->dirtyInventory(); + hit_obj->requestInventory(); + // TODO: Check to see if adding the item was successful; if not, then + // we should return false here. This will requre a separate listener + // since without listener, we have no way to receive update + } return TRUE; } |