diff options
author | Oz Linden <oz@lindenlab.com> | 2011-08-20 07:15:41 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2011-08-20 07:15:41 -0400 |
commit | dbc8d51cd028da9bb5195b0b1f46bbaaff0c84e6 (patch) | |
tree | 5c47ef868bf7e302cb1f3c4e465321e8465b7fcd /indra/newview/llinventorybridge.cpp | |
parent | 574e24c34e79828a136b1bc26b20ec8cc0405d71 (diff) | |
parent | 73025e27719927ec72eddc6e111ae782b1faf0ae (diff) |
merge changes for storm-1041
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index ff328fd071..f0fc710f3d 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -4925,31 +4925,22 @@ void LLWearableBridge::onRemoveFromAvatarArrived(LLWearable* wearable, // static void LLWearableBridge::removeAllClothesFromAvatar() { - // Remove COF links. - for (S32 itype = LLWearableType::WT_SHAPE; itype < LLWearableType::WT_COUNT; ++itype) - { - if (itype == LLWearableType::WT_SHAPE || itype == LLWearableType::WT_SKIN || itype == LLWearableType::WT_HAIR || itype == LLWearableType::WT_EYES) - continue; - - for (S32 index = gAgentWearables.getWearableCount(itype)-1; index >= 0 ; --index) - { - LLViewerInventoryItem *item = dynamic_cast<LLViewerInventoryItem*>( - gAgentWearables.getWearableInventoryItem((LLWearableType::EType)itype, index)); - if (!item) - continue; - const LLUUID &item_id = item->getUUID(); - const LLWearable *wearable = gAgentWearables.getWearableFromItemID(item_id); - if (!wearable) - continue; - - // Find and remove this item from the COF. - LLAppearanceMgr::instance().removeCOFItemLinks(item_id,false); - } + // 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()); } - gInventory.notifyObservers(); - - // Remove wearables from gAgentWearables - LLAgentWearables::userRemoveAllClothes(); } // static |