From 514e4f661bbf4355ead4e60288c0075cc945b597 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 13 Dec 2018 20:01:01 +0200 Subject: SL-10236 The "Attach To", "Attach To HUD", and "Wear" options aren't greyed out --- indra/newview/lloutfitslist.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'indra/newview/lloutfitslist.cpp') diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 892fa385d7..f2a284a561 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -621,8 +621,14 @@ void LLOutfitsList::applyFilterToTab( bool LLOutfitsList::canWearSelected() { + if (!isAgentAvatarValid()) + { + return false; + } + uuid_vec_t selected_items; getSelectedItemsUUIDs(selected_items); + S32 nonreplacable_objects = 0; for (uuid_vec_t::const_iterator it = selected_items.begin(); it != selected_items.end(); ++it) { @@ -633,10 +639,21 @@ bool LLOutfitsList::canWearSelected() { return false; } + + const LLViewerInventoryItem* item = gInventory.getItem(id); + if (!item) + { + return false; + } + + if (item->getType() == LLAssetType::AT_OBJECT) + { + nonreplacable_objects++; + } } - // All selected items can be worn. - return true; + // All selected items can be worn. But do we have enough space for them? + return nonreplacable_objects == 0 || gAgentAvatarp->canAttachMoreObjects(nonreplacable_objects); } void LLOutfitsList::wearSelectedItems() -- cgit v1.2.3