diff options
| author | Kitty Barnett <develop@catznip.com> | 2026-02-28 20:18:47 +0100 |
|---|---|---|
| committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2026-03-15 21:55:33 +0200 |
| commit | 4034714980dd36a454639b1324cfac6a6bd8bf59 (patch) | |
| tree | fff9f923c217adfe6d9a28a872bc8b0e5d0590fb | |
| parent | 5bc81c9decd000d0218d80319f1fa307c0acb7f4 (diff) | |
[FIXED] Wearing >56 clothing items will incorrectly filter since body parts are passed in as well
| -rw-r--r-- | indra/newview/llappearancemgr.cpp | 18 | ||||
| -rw-r--r-- | indra/newview/llappearancemgr.h | 2 |
2 files changed, 14 insertions, 6 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 5845477554..8aa28e1b09 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2084,15 +2084,23 @@ void LLAppearanceMgr::purgeBaseOutfitLink(const LLUUID& category, LLPointer<LLIn // Keep the last N wearables of each type. For viewer 2.0, N is 1 for // both body parts and clothing items. void LLAppearanceMgr::filterWearableItems( - LLInventoryModel::item_array_t& items, S32 max_per_type, S32 max_total) + LLInventoryModel::item_array_t& items, S32 max_per_type, S32 max_total, bool skip_bodyparts) { // Restrict by max total items first. if ((max_total > 0) && (items.size() > max_total)) { - LLInventoryModel::item_array_t items_to_keep; - for (S32 i=0; i<max_total; i++) + LLInventoryModel::item_array_t items_to_keep; size_t non_body_kept = 0; + for (const auto& item : items) { - items_to_keep.push_back(items[i]); + if (skip_bodyparts && item.get() && item.get()->getType() == LLAssetType::AT_BODYPART) + { + items_to_keep.push_back(item); + } + else if (non_body_kept < max_total) + { + items_to_keep.push_back(item); + non_body_kept++; + } } items = items_to_keep; } @@ -2581,7 +2589,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool enforce_item_restrictions, removeDuplicateItems(wear_items); removeDuplicateItems(obj_items); removeDuplicateItems(gest_items); - filterWearableItems(wear_items, 0, LLAgentWearables::MAX_CLOTHING_LAYERS); + filterWearableItems(wear_items, 0, LLAgentWearables::MAX_CLOTHING_LAYERS, true); dumpItemArray(wear_items,"asset_dump: wear_item"); dumpItemArray(obj_items,"asset_dump: obj_item"); diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 46028abb3e..9d90be0004 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -250,7 +250,7 @@ private: private: - void filterWearableItems(LLInventoryModel::item_array_t& items, S32 max_per_type, S32 max_total); + void filterWearableItems(LLInventoryModel::item_array_t& items, S32 max_per_type, S32 max_total, bool skip_bodyparts = false); void getDescendentsOfAssetType(const LLUUID& category, LLInventoryModel::item_array_t& items, |
