From 3bbf4f05b664e36f9769cc7de9057bc0fb72d890 Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Sun, 7 Nov 2021 14:52:41 -0500
Subject: [PATCH] Unbreak attachment count logic

---
 indra/newview/llvoavatar.cpp | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index f9f5b409ff4..6a1dc9b6446 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -7563,15 +7563,10 @@ const LLViewerJointAttachment *LLVOAvatar::attachObject(LLViewerObject *viewer_o
 U32 LLVOAvatar::getNumAttachments() const
 {
 	U32 num_attachments = 0;
-#if SLOW_ATTACHMENT_LIST
+
 	for (const auto& attach_pair : mAttachmentPoints)
 	{
 		const LLViewerJointAttachment* attachment_pt = attach_pair.second;
-#else
-	for (auto& iter : mAttachedObjectsVector)
-	{
-		const LLViewerJointAttachment* attachment_pt = iter.second;
-#endif
 		num_attachments += attachment_pt->getNumObjects();
 	}
 	return num_attachments;
@@ -7600,15 +7595,10 @@ BOOL LLVOAvatar::canAttachMoreObjects(U32 n) const
 U32 LLVOAvatar::getNumAnimatedObjectAttachments() const
 {
 	U32 num_attachments = 0;
-#if SLOW_ATTACHMENT_LIST
+
 	for (const auto& attach_pair : mAttachmentPoints)
 	{
 		const LLViewerJointAttachment *attachment_pt = attach_pair.second;
-#else
-	for (auto& iter : mAttachedObjectsVector)
-	{
-		const LLViewerJointAttachment* attachment_pt = iter.second;
-#endif
 		num_attachments += attachment_pt->getNumAnimatedObjects();
 	}
 	return num_attachments;
@@ -7712,9 +7702,8 @@ void LLVOAvatar::rebuildRiggedAttachments( void )
 	for(auto& iter : mAttachedObjectsVector)
 	{{
 			const LLViewerObject* pAttachedObject = iter.first;
-			const LLViewerJointAttachment* pAttachment = iter.second;
 #endif
-			if ( pAttachment && pAttachedObject->mDrawable.notNull() )
+			if (pAttachedObject && pAttachedObject->mDrawable.notNull() )
 			{
 				gPipeline.markRebuild(pAttachedObject->mDrawable);
 			}
-- 
GitLab