diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2012-08-21 17:03:42 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2012-08-21 17:03:42 -0400 |
commit | b232919c0a6d66582b57c8997fee7a99ab9bbddb (patch) | |
tree | f343ab51c49bdeffff0dc0a38d68fc1de36f36a0 /indra/newview/llinventorybridge.cpp | |
parent | 2db20dd01b12be830e8b5ac58172e9963b73eba1 (diff) |
SH-3625 WIP - consolidating code paths for wearable/attachment removal
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rwxr-xr-x[-rw-r--r--] | indra/newview/llinventorybridge.cpp | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index b819100b9b..e07365109b 100644..100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2764,7 +2764,7 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) LLViewerInventoryCategory* cat = getCategory(); if(!cat) return; - remove_inventory_category_from_avatar ( cat ); + LLAppearanceMgr::instance().takeOffOutfit( cat->getLinkedUUID() ); return; } else if ("purge" == action) @@ -5073,11 +5073,7 @@ void LLObjectBridge::performAction(LLInventoryModel* model, std::string action) } else if (isRemoveAction(action)) { - LLInventoryItem* item = gInventory.getItem(mUUID); - if(item) - { - LLVOAvatarSelf::detachAttachmentIntoInventory(item->getLinkedUUID()); - } + LLAppearanceMgr::instance().removeItemFromAvatar(mUUID); } else LLItemBridge::performAction(model, action); } @@ -5828,29 +5824,9 @@ void LLWearableBridge::onRemoveFromAvatarArrived(LLWearable* wearable, } // static -void LLWearableBridge::removeAllClothesFromAvatar() -{ - // Fetch worn clothes (i.e. the ones in COF). - LLInventoryModel::item_array_t clothing_items; - LLInventoryModel::cat_array_t dummy; - LLIsType is_clothing(LLAssetType::AT_CLOTHING); - gInventory.collectDescendentsIf(LLAppearanceMgr::instance().getCOF(), - dummy, - clothing_items, - LLInventoryModel::EXCLUDE_TRASH, - is_clothing, - false); - - // Take them off by removing from COF. - for (LLInventoryModel::item_array_t::const_iterator it = clothing_items.begin(); it != clothing_items.end(); ++it) - { - LLAppearanceMgr::instance().removeItemFromAvatar((*it)->getUUID()); - } -} - -// static void LLWearableBridge::removeItemFromAvatar(LLViewerInventoryItem *item) { + llwarns << "safe to remove?" << llendl; if (item) { LLWearableList::instance().getAsset(item->getAssetUUID(), @@ -5863,10 +5839,10 @@ void LLWearableBridge::removeItemFromAvatar(LLViewerInventoryItem *item) void LLWearableBridge::removeFromAvatar() { + llwarns << "safe to remove?" << llendl; if (get_is_item_worn(mUUID)) { - LLViewerInventoryItem* item = getItem(); - removeItemFromAvatar(item); + LLAppearanceMgr::instance().removeItemFromAvatar(mUUID); } } |