From a8f40db04955df76eb91d7a5eaecee939c877f21 Mon Sep 17 00:00:00 2001
From: Loren Shih <seraph@lindenlab.com>
Date: Thu, 26 Aug 2010 11:59:19 -0400
Subject: [PATCH] EXT-8751 FIXED "Create new" in Edit Outfit doesn't actually
 check if you can legally create a new item

Create New now makes sure you haven't exceeded max wearables.
Also took out debug camera hack.
---
 indra/newview/llwearableitemslist.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp
index b777885f796..858c86b13db 100644
--- a/indra/newview/llwearableitemslist.cpp
+++ b/indra/newview/llwearableitemslist.cpp
@@ -889,6 +889,7 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu
 	setMenuItemVisible(menu, "edit",				!standalone && mask & (MASK_CLOTHING|MASK_BODYPART) && n_worn == n_items && n_worn == 1);
 	setMenuItemEnabled(menu, "edit",				n_editable == 1 && n_worn == 1 && n_items == 1);
 	setMenuItemVisible(menu, "create_new",			mask & (MASK_CLOTHING|MASK_BODYPART) && n_items == 1);
+	setMenuItemEnabled(menu, "create_new",			canAddWearable(ids.front()));
 	setMenuItemVisible(menu, "show_original",		!standalone);
 	setMenuItemEnabled(menu, "show_original",		n_items == 1 && n_links == n_items);
 	setMenuItemVisible(menu, "take_off",			mask == MASK_CLOTHING && n_worn == n_items);
@@ -1039,6 +1040,10 @@ bool LLWearableItemsList::ContextMenu::canAddWearables(const uuid_vec_t& item_id
 		U32 n_clothes					= m_it->second;
 
 		U32 wearable_count = gAgentWearables.getWearableCount(w_type);
+		if ((wearable_count > 0) && !LLWearableType::getAllowMultiwear(w_type))
+		{
+			return false;
+		}
 		if ((wearable_count + n_clothes) > LLAgentWearables::MAX_CLOTHING_PER_TYPE)
 		{
 			return false;
-- 
GitLab