summaryrefslogtreecommitdiff
path: root/indra/newview/llvoavatarself.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2010-08-13 11:12:51 -0400
committerLoren Shih <seraph@lindenlab.com>2010-08-13 11:12:51 -0400
commit5881252ab2e9ab31b05c1a54d8ce723013eee15a (patch)
tree5031e4f66cc11e722f874f702c09598bfb1f2050 /indra/newview/llvoavatarself.cpp
parent40eda71ff0cbc73efbe7520c73406cce39d763bb (diff)
EXT-8650 Can wear multiple copies of no-copy item via object links
* EXT-8688 Automatically detach same object is detected * EXT-8689 Cleanup detachAttachmentIntoInventory code When an object arrives as an attachment, if it's already attached then it's automatically detached.
Diffstat (limited to 'indra/newview/llvoavatarself.cpp')
-rw-r--r--indra/newview/llvoavatarself.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index 73ea629bc3..09e50dcb90 100644
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -1115,6 +1115,29 @@ BOOL LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object)
return FALSE;
}
+// static
+BOOL LLVOAvatarSelf::detachAttachmentIntoInventory(const LLUUID &item_id)
+{
+ LLInventoryItem* item = gInventory.getItem(item_id);
+ if (item)
+ {
+ gMessageSystem->newMessageFast(_PREHASH_DetachAttachmentIntoInv);
+ gMessageSystem->nextBlockFast(_PREHASH_ObjectData);
+ gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
+ gMessageSystem->addUUIDFast(_PREHASH_ItemID, item_id);
+ gMessageSystem->sendReliable(gAgent.getRegion()->getHost());
+
+ // this object might have been selected, so let the selection manager know it's gone now
+ LLViewerObject *found_obj = gObjectList.findObject(item_id);
+ if (found_obj)
+ {
+ LLSelectMgr::getInstance()->remove(found_obj);
+ }
+ return TRUE;
+ }
+ return FALSE;
+}
+
U32 LLVOAvatarSelf::getNumWearables(LLVOAvatarDefines::ETextureIndex i) const
{
LLWearableType::EType type = LLVOAvatarDictionary::getInstance()->getTEWearableType(i);