From a2bdba7aa245e412e0cd120eb10c76df1598104c Mon Sep 17 00:00:00 2001
From: Rider Linden <rider@lindenlab.com>
Date: Wed, 2 Mar 2016 12:06:19 -0800
Subject: [PATCH] MAINT-5693: Only force forward progression of COF version for
 your own Avatar

---
 indra/newview/llvoavatar.cpp | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 62ee1a64245..69709f2bc9d 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -7356,7 +7356,7 @@ bool resolve_appearance_version(const LLAppearanceMessageContents& contents, S32
 //-----------------------------------------------------------------------------
 void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
 {
-    static S32 largestCOFSeen(LLViewerInventoryCategory::VERSION_UNKNOWN);
+    static S32 largestSelfCOFSeen(LLViewerInventoryCategory::VERSION_UNKNOWN);
 	LL_DEBUGS("Avatar") << "starts" << LL_ENDL;
 	
 	bool enable_verbose_dumps = gSavedSettings.getBOOL("DebugAvatarAppearanceMessage");
@@ -7394,19 +7394,26 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
 	S32 this_update_cof_version = contents.mCOFVersion;
 	S32 last_update_request_cof_version = mLastUpdateRequestCOFVersion;
 
-    if (largestCOFSeen > this_update_cof_version)
+    if (largestSelfCOFSeen > this_update_cof_version)
     {
-        LL_WARNS("Avatar") << "Already processed appearance for COF version " <<
-            largestCOFSeen << ", discarding appearance with COF " << this_update_cof_version << LL_ENDL;
-        return;
+        LL_WARNS("Avatar") << "****BUG WOULD HAVE HAPPENED****" <<
+            largestSelfCOFSeen << " > " << this_update_cof_version << LL_ENDL;
     }
-    largestCOFSeen = this_update_cof_version;
 
 	if( isSelf() )
 	{
 		LL_DEBUGS("Avatar") << "this_update_cof_version " << this_update_cof_version
 				<< " last_update_request_cof_version " << last_update_request_cof_version
 				<<  " my_cof_version " << LLAppearanceMgr::instance().getCOFVersion() << LL_ENDL;
+
+        if (largestSelfCOFSeen > this_update_cof_version)
+        {
+            LL_WARNS("Avatar") << "Already processed appearance for COF version " <<
+                largestSelfCOFSeen << ", discarding appearance with COF " << this_update_cof_version << LL_ENDL;
+            return;
+        }
+        largestSelfCOFSeen = this_update_cof_version;
+
 	}
 	else
 	{
-- 
GitLab