diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2013-12-05 10:39:35 -0500 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2013-12-05 10:39:35 -0500 |
commit | 744cf6be8d5a808020a4d6cc98ff4c6b208239c0 (patch) | |
tree | fab4ec7a30752ef1087d15540899830bf766cb89 /indra/newview/llappearancemgr.cpp | |
parent | 1320e5ddcd9fc3be526dcacbf4710f8bcf878665 (diff) | |
parent | 787ccaf297e81291469aaf269f563d862fb150a3 (diff) |
merge
Diffstat (limited to 'indra/newview/llappearancemgr.cpp')
-rwxr-xr-x | indra/newview/llappearancemgr.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index f6c9bf6953..cf26f590d7 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3640,6 +3640,7 @@ void LLAppearanceMgr::removeItemsFromAvatar(const uuid_vec_t& ids_to_remove) const LLUUID& id_to_remove = *it; const LLUUID& linked_item_id = gInventory.getLinkedItemID(id_to_remove); removeCOFItemLinks(linked_item_id, cb); + addDoomedTempAttachment(linked_item_id); } } @@ -3648,8 +3649,36 @@ void LLAppearanceMgr::removeItemFromAvatar(const LLUUID& id_to_remove) LLUUID linked_item_id = gInventory.getLinkedItemID(id_to_remove); LLPointer<LLInventoryCallback> cb = new LLUpdateAppearanceOnDestroy; removeCOFItemLinks(linked_item_id, cb); + addDoomedTempAttachment(linked_item_id); } + +// Adds the given item ID to mDoomedTempAttachmentIDs iff it's a temp attachment +void LLAppearanceMgr::addDoomedTempAttachment(const LLUUID& id_to_remove) +{ + LLViewerObject * attachmentp = gAgentAvatarp->findAttachmentByID(id_to_remove); + if (attachmentp && + attachmentp->isTempAttachment()) + { // If this is a temp attachment and we want to remove it, record the ID + // so it will be deleted when attachments are synced up with COF + mDoomedTempAttachmentIDs.insert(id_to_remove); + //llinfos << "Will remove temp attachment id " << id_to_remove << llendl; + } +} + +// Find AND REMOVES the given UUID from mDoomedTempAttachmentIDs +bool LLAppearanceMgr::shouldRemoveTempAttachment(const LLUUID& item_id) +{ + doomed_temp_attachments_t::iterator iter = mDoomedTempAttachmentIDs.find(item_id); + if (iter != mDoomedTempAttachmentIDs.end()) + { + mDoomedTempAttachmentIDs.erase(iter); + return true; + } + return false; +} + + bool LLAppearanceMgr::moveWearable(LLViewerInventoryItem* item, bool closer_to_body) { if (!item || !item->isWearableType()) return false; |