From e5484e56b3c13e65bd31d7bf21c1cd3a2d9333f2 Mon Sep 17 00:00:00 2001 From: Neal Orman Date: Thu, 22 Oct 2009 18:29:52 +0000 Subject: EXT-1784 Server getting spammed whenever you put on a wearable Made an adjustment to ignore remove requests on items that don't exist, to avoid the extra messages to the server. Also made a couple of adjustments to ensure removal of alpha masks and tattoos along with other wearable types. Added these code points to the wiki page detailing what modifications need to be made when adding a new wearable type: https://wiki.lindenlab.com/wiki/User:Vir#Adding_new_wearables Code reviewed by Seraph. --- indra/newview/llagentwearables.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index bb00468d40..c1866c36a2 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1310,6 +1310,11 @@ void LLAgentWearables::removeWearable(const EWearableType type, bool do_remove_a // TODO: enable the removing of a single undershirt/underpants if multiple are worn. - Nyx return; } + if (getWearableCount(type) == 0) + { + // no wearables to remove + return; + } if (do_remove_all) { @@ -1431,6 +1436,9 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it wearables_to_remove[WT_UNDERSHIRT] = (!gAgent.isTeen()) & remove; wearables_to_remove[WT_UNDERPANTS] = (!gAgent.isTeen()) & remove; wearables_to_remove[WT_SKIRT] = remove; + wearables_to_remove[WT_ALPHA] = remove; + wearables_to_remove[WT_TATTOO] = remove; + S32 count = wearables.count(); llassert(items.count() == count); @@ -1743,6 +1751,8 @@ void LLAgentWearables::userRemoveAllClothesStep2(BOOL proceed) gAgentWearables.removeWearable(WT_UNDERSHIRT,true,0); gAgentWearables.removeWearable(WT_UNDERPANTS,true,0); gAgentWearables.removeWearable(WT_SKIRT,true,0); + gAgentWearables.removeWearable(WT_ALPHA,true,0); + gAgentWearables.removeWearable(WT_TATTOO,true,0); } } -- cgit v1.2.3