diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-05-20 11:47:15 +0100 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-05-20 11:47:15 +0100 |
commit | 9c779e222eb6f929003e2cce446850dfbc306063 (patch) | |
tree | 2837aacd1966ea429ea450bb7869e5b6595db309 /indra/newview/llinventorybridge.cpp | |
parent | 02fe5d60c0a6664bb86254347ce31467da2d90c3 (diff) | |
parent | ae0dbecb1c93347f7d83760117496048af3148da (diff) |
merge from viewer-public
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index b9b4fa8b03..ab7eeae3e8 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -4980,18 +4980,20 @@ void LLWearableBridge::removeAllClothesFromAvatar() if (itype == LLWearableType::WT_SHAPE || itype == LLWearableType::WT_SKIN || itype == LLWearableType::WT_HAIR || itype == LLWearableType::WT_EYES) continue; - // MULTI-WEARABLES: fixed to index 0 - LLViewerInventoryItem *item = dynamic_cast<LLViewerInventoryItem*>( - gAgentWearables.getWearableInventoryItem((LLWearableType::EType)itype, 0)); - if (!item) - continue; - const LLUUID &item_id = gInventory.getLinkedItemID(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); + 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 = gInventory.getLinkedItemID(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); + } } gInventory.notifyObservers(); |