diff options
| author | Nyx (Neal Orman) <nyx@lindenlab.com> | 2010-06-04 17:34:46 -0400 | 
|---|---|---|
| committer | Nyx (Neal Orman) <nyx@lindenlab.com> | 2010-06-04 17:34:46 -0400 | 
| commit | 244321e70cf341ca0542a9963d9e1e68cafca8d5 (patch) | |
| tree | b629679a1e0e76a17203b6b077f6e13295ca3b28 /indra | |
| parent | c26eeb6f7a51759bc4597ab7ae6efc80ee50b1c3 (diff) | |
AVP-44 VWR-19699 FIX Multi-wearables and wearable replacement logic
Cleaned up a few things upon code review.
Code reviewed by vir for this checkin as well as following previous commits:
a801af3728ee
af42810b946c
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/llappearancemgr.cpp | 15 | ||||
| -rw-r--r-- | indra/newview/llviewermenu.cpp | 4 | 
2 files changed, 8 insertions, 11 deletions
| diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 9da47c9214..a899926938 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -659,12 +659,7 @@ bool LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear, bool do_up  	LLViewerInventoryItem* item_to_wear = gInventory.getItem(item_id_to_wear);  	if (!item_to_wear) return false; -	if (!item_to_wear->isFinished()) -	{ -		LLNotificationsUtil::add("CannotWearInfoNotComplete"); -		return false; -	} -	else if (gInventory.isObjectDescendentOf(item_to_wear->getUUID(), gInventory.getLibraryRootFolderID())) +	if (gInventory.isObjectDescendentOf(item_to_wear->getUUID(), gInventory.getLibraryRootFolderID()))  	{  		LLPointer<LLInventoryCallback> cb = new WearOnAvatarCallback(replace);  		copy_inventory_item(gAgent.getID(), item_to_wear->getPermissions().getOwner(), item_to_wear->getUUID(), LLUUID::null, std::string(),cb); @@ -677,6 +672,7 @@ bool LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear, bool do_up  	else if (gInventory.isObjectDescendentOf(item_to_wear->getUUID(), gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH)))  	{  		LLNotificationsUtil::add("CannotWearTrash"); +		return false;  	}  	switch (item_to_wear->getType()) @@ -1605,15 +1601,14 @@ void LLAppearanceMgr::addCOFItemLink(const LLInventoryItem *item, bool do_update  		// type? If so, new item will replace old.  		else if ((vitem->isWearableType()) && (vitem->getWearableType() == wearable_type))  		{ +			++count;  			if (is_body_part && inv_item->getIsLinkType()  && (vitem->getWearableType() == wearable_type))  			{  				gInventory.purgeObject(inv_item->getUUID());  			} -			++count; - -			// MULTI-WEARABLES: make sure we don't go over MAX_CLOTHING_PER_TYPE -			if (count >= LLAgentWearables::MAX_CLOTHING_PER_TYPE) +			else if (count >= LLAgentWearables::MAX_CLOTHING_PER_TYPE)  			{ +				// MULTI-WEARABLES: make sure we don't go over MAX_CLOTHING_PER_TYPE  				gInventory.purgeObject(inv_item->getUUID());  			}  		} diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 23fb97a358..2c7ae539ce 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -7495,7 +7495,9 @@ class LLEditTakeOff : public view_listener_t  		else  		{  			LLWearableType::EType type = LLWearableType::typeNameToType(clothing); -			if (type >= LLWearableType::WT_SHAPE && type < LLWearableType::WT_COUNT) +			if (type >= LLWearableType::WT_SHAPE  +				&& type < LLWearableType::WT_COUNT +				&& (gAgentWearables.getWearableCount(type) > 0))  			{  				// MULTI-WEARABLES: assuming user wanted to remove top shirt.  				U32 wearable_index = gAgentWearables.getWearableCount(type) - 1; | 
