From 05c14aa5588596a3bef49cee45e648c1f5ef18b7 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Tue, 4 Jan 2011 13:52:29 +0200 Subject: STORM-702 FIXED Made it possible to wear partial outfits Enabled the "Replace Current Outfit" option for incomplete outfits (i.e. those that don't contain full set of body parts). --- indra/newview/llappearancemgr.cpp | 12 ++++++++++-- indra/newview/llinventoryfunctions.cpp | 6 ++++++ 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 80734b0d41..f40fed5ad3 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1300,8 +1300,16 @@ bool LLAppearanceMgr::getCanReplaceCOF(const LLUUID& outfit_cat_id) return false; } - // Check whether the outfit contains the full set of body parts (shape+skin+hair+eyes). - return getCanMakeFolderIntoOutfit(outfit_cat_id); + // Check whether the outfit contains any wearables we aren't wearing already (STORM-702). + LLInventoryModel::cat_array_t cats; + LLInventoryModel::item_array_t items; + LLFindWearablesEx is_worn(/*is_worn=*/ false, /*include_body_parts=*/ true); + gInventory.collectDescendentsIf(outfit_cat_id, + cats, + items, + LLInventoryModel::EXCLUDE_TRASH, + is_worn); + return items.size() > 0; } void LLAppearanceMgr::purgeBaseOutfitLink(const LLUUID& category) diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index ef20869114..61d0a150b7 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -686,6 +686,12 @@ bool LLFindWearablesEx::operator()(LLInventoryCategory* cat, LLInventoryItem* it return false; } + // Skip broken links. + if (vitem->getIsBrokenLink()) + { + return false; + } + return (bool) get_is_item_worn(item->getUUID()) == mIsWorn; } -- cgit v1.2.3