From 4fb7fd9fffde08ffad4b2fe8f5ead5e500d76419 Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Wed, 2 Dec 2009 17:45:42 -0500
Subject: [PATCH] For EXT-3030: Gestures in outfits do not deactivate when
 another outfit is worn

--HG--
branch : avatar-pipeline
---
 indra/newview/llappearancemgr.cpp | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index c7f05d99f7f..d91b9d7ea43 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -512,6 +512,21 @@ void LLAppearanceManager::updateCOF(const LLUUID& category, bool append)
 {
 	const LLUUID cof = getCOF();
 
+	// Deactivate currently active gestures in the COF, if replacing outfit
+	if (!append)
+	{
+		LLInventoryModel::item_array_t gest_items;
+		getDescendentsOfAssetType(cof, gest_items, LLAssetType::AT_GESTURE, false);
+		for(S32 i = 0; i  < gest_items.count(); ++i)
+		{
+			LLViewerInventoryItem *gest_item = gest_items.get(i);
+			if ( LLGestureManager::instance().isGestureActive( gest_item->getLinkedUUID()) )
+			{
+				LLGestureManager::instance().deactivateGesture( gest_item->getLinkedUUID() );
+			}
+		}
+	}
+	
 	// Collect and filter descendents to determine new COF contents.
 
 	// - Body parts: always include COF contents as a fallback in case any
-- 
GitLab