summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorybridge.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r--indra/newview/llinventorybridge.cpp26
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();