diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2012-08-20 18:11:07 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2012-08-20 18:11:07 -0400 |
commit | 2db20dd01b12be830e8b5ac58172e9963b73eba1 (patch) | |
tree | 85777f0ed4a32e5521ec62dc7532d9d9ce5dc82b /indra/newview | |
parent | 3a255dfa7980bf20590b4a65a8cf916e57a998b6 (diff) |
SH-3625 WIP - removeItem(s)FromAvatar use updateAppearanceFromCOF. Some but not all remove code goes through these.
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/llappearancemgr.cpp | 21 | ||||
-rwxr-xr-x | indra/newview/llappearancemgr.h | 1 |
2 files changed, 21 insertions, 1 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 5f1a880ebd..0b425b656c 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1160,11 +1160,13 @@ void LLAppearanceMgr::takeOffOutfit(const LLUUID& cat_id) LLInventoryModel::item_array_t::const_iterator it = items.begin(); const LLInventoryModel::item_array_t::const_iterator it_end = items.end(); + uuid_vec_t uuids_to_remove; for( ; it_end != it; ++it) { LLViewerInventoryItem* item = *it; - removeItemFromAvatar(item->getUUID()); + uuids_to_remove.push_back(item->getUUID()); } + removeItemsFromAvatar(uuids_to_remove); } // Create a copy of src_id + contents as a subfolder of dst_id. @@ -2706,8 +2708,24 @@ void LLAppearanceMgr::wearBaseOutfit() updateCOF(base_outfit_id); } +void LLAppearanceMgr::removeItemsFromAvatar(const uuid_vec_t& ids_to_remove) +{ + for (uuid_vec_t::const_iterator it = ids_to_remove.begin(); it != ids_to_remove.end(); ++it) + { + const LLUUID& id_to_remove = *it; + const LLUUID& linked_item_id = gInventory.getLinkedItemID(id_to_remove); + removeCOFItemLinks(linked_item_id,false); + } + updateAppearanceFromCOF(); +} + void LLAppearanceMgr::removeItemFromAvatar(const LLUUID& id_to_remove) { +#if 1 + LLUUID linked_item_id = gInventory.getLinkedItemID(id_to_remove); + removeCOFItemLinks(linked_item_id,false); + updateAppearanceFromCOF(); +#else LLViewerInventoryItem * item_to_remove = gInventory.getItem(id_to_remove); if (!item_to_remove) return; @@ -2733,6 +2751,7 @@ void LLAppearanceMgr::removeItemFromAvatar(const LLUUID& id_to_remove) // Also we can't check is link was successfully removed from COF since in case // deleting attachment link removing performs asynchronously in process_kill_object callback. removeCOFItemLinks(id_to_remove,false); +#endif } bool LLAppearanceMgr::moveWearable(LLViewerInventoryItem* item, bool closer_to_body) diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 742833211a..c0f41075aa 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -165,6 +165,7 @@ public: bool updateBaseOutfit(); //Remove clothing or detach an object from the agent (a bodypart cannot be removed) + void removeItemsFromAvatar(const uuid_vec_t& item_ids); void removeItemFromAvatar(const LLUUID& item_id); |