From dc365be4d23d8070a4f9e670918dbe8ccbe8cc79 Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Wed, 4 Nov 2009 18:03:04 -0500
Subject: [PATCH] For EXT-1985: Clothing previously taken off is re-worn when
 creating a new clothing item in appearance mode.

General problem with failing to update the COF when clothing items were removed.  Added hook in removeWearableFinal, which should guarantee that we're always removing clothing links when we need to.
---
 indra/newview/llagentwearables.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index 4b3d27767c8..7d215b57781 100644
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -1393,6 +1393,7 @@ void LLAgentWearables::removeWearableFinal(const EWearableType type, bool do_rem
 			const LLUUID &item_id = getWearableItemID(type,i);
 			popWearable(type,i);
 			gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id);
+			LLAppearanceManager::removeItemLinks(item_id,false);
 
 			//queryWearableCache(); // moved below
 			if (old_wearable)
@@ -1409,6 +1410,7 @@ void LLAgentWearables::removeWearableFinal(const EWearableType type, bool do_rem
 		const LLUUID &item_id = getWearableItemID(type,index);
 		popWearable(type, index);
 		gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id);
+		LLAppearanceManager::removeItemLinks(item_id,false);
 
 		//queryWearableCache(); // moved below
 
-- 
GitLab