summaryrefslogtreecommitdiff
path: root/indra/newview/llpaneloutfitedit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpaneloutfitedit.cpp')
-rw-r--r--indra/newview/llpaneloutfitedit.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp
index 1544717873..ffd879dfd7 100644
--- a/indra/newview/llpaneloutfitedit.cpp
+++ b/indra/newview/llpaneloutfitedit.cpp
@@ -661,10 +661,13 @@ void LLPanelOutfitEdit::onInventorySelectionChange()
getSelectedItemsUUID(selected_items);
if (selected_items.empty())
{
+ mPlusBtn->setEnabled(false);
return;
}
- uuid_vec_t::iterator worn_item = std::find_if(selected_items.begin(), selected_items.end(), boost::bind(&get_is_item_worn, _1));
- bool can_add = ( worn_item == selected_items.end() );
+
+ // If any of the selected items are not wearable (due to already being worn OR being of the wrong type), disable the add button.
+ uuid_vec_t::iterator unwearable_item = std::find_if(selected_items.begin(), selected_items.end(), !boost::bind(& get_can_item_be_worn, _1));
+ bool can_add = ( unwearable_item == selected_items.end() );
mPlusBtn->setEnabled(can_add);