diff options
author | Oz Linden <oz@lindenlab.com> | 2014-03-04 13:15:43 -0500 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2014-03-04 13:15:43 -0500 |
commit | a373a7442c244712ab17d793072699ef82684816 (patch) | |
tree | 2ed20e24993c4bfbb4f943ed7794fcd06eeb8a23 /indra/newview/llagentwearables.cpp | |
parent | b0c255f4e6141246f3575cb3d5b671af19966de9 (diff) | |
parent | de8fea13627cc5978b8a6135802a52864a11c39a (diff) |
merge changes for 3.7.2-release
Diffstat (limited to 'indra/newview/llagentwearables.cpp')
-rwxr-xr-x | indra/newview/llagentwearables.cpp | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 1edbbe2a2e..fa810aac76 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1538,7 +1538,11 @@ void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj std::set<LLUUID> requested_item_ids; std::set<LLUUID> current_item_ids; for (S32 i=0; i<obj_item_array.count(); i++) - requested_item_ids.insert(obj_item_array[i].get()->getLinkedUUID()); + { + const LLUUID & requested_id = obj_item_array[i].get()->getLinkedUUID(); + //llinfos << "Requested attachment id " << requested_id << llendl; + requested_item_ids.insert(requested_id); + } // Build up list of objects to be removed and items currently attached. llvo_vec_t objects_to_remove; @@ -1555,17 +1559,28 @@ void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj if (objectp) { LLUUID object_item_id = objectp->getAttachmentItemID(); + + bool remove_attachment = true; if (requested_item_ids.find(object_item_id) != requested_item_ids.end()) - { - // Object currently worn, was requested. + { // Object currently worn, was requested to keep it // Flag as currently worn so we won't have to add it again. - current_item_ids.insert(object_item_id); + remove_attachment = false; } - else + else if (objectp->isTempAttachment()) + { // Check if we should keep this temp attachment + remove_attachment = LLAppearanceMgr::instance().shouldRemoveTempAttachment(objectp->getID()); + } + + if (remove_attachment) { - // object currently worn, not requested. + // llinfos << "found object to remove, id " << objectp->getID() << ", item " << objectp->getAttachmentItemID() << llendl; objects_to_remove.push_back(objectp); } + else + { + // llinfos << "found object to keep, id " << objectp->getID() << ", item " << objectp->getAttachmentItemID() << llendl; + current_item_ids.insert(object_item_id); + } } } } |