diff options
author | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-01-04 13:52:29 +0200 |
---|---|---|
committer | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-01-04 13:52:29 +0200 |
commit | 05c14aa5588596a3bef49cee45e648c1f5ef18b7 (patch) | |
tree | a34bb8f371f38443170c5b08c7785c4c12e2be33 | |
parent | cc3f0d287c7edb9e4cfe18985f2758e815502440 (diff) |
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).
-rw-r--r-- | indra/newview/llappearancemgr.cpp | 12 | ||||
-rw-r--r-- | indra/newview/llinventoryfunctions.cpp | 6 |
2 files changed, 16 insertions, 2 deletions
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; } |