From 14532f0aa01524b9062583081f8902c2aaf7abf1 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 4 May 2010 15:29:56 -0400 Subject: DEV-49557 : FIXED : Attachments can show up hanging in space Adding viewer-side sanity check to make sure attachments have a legal slot. --- indra/newview/llvoavatar.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 3f021d1f84..c15fd563ae 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5473,6 +5473,14 @@ LLViewerJointAttachment* LLVOAvatar::getTargetAttachmentPoint(LLViewerObject* vi { S32 attachmentID = ATTACHMENT_ID_FROM_STATE(viewer_object->getState()); + // This should never happen unless the server didn't process the attachment point + // correctly, but putting this check in here to be safe. + if (attachmentID & ATTACHMENT_ADD) + { + llwarns << "Got an attachment with ATTACHMENT_ADD mask, removing ( attach pt:" << attachmentID << " )" << llendl; + attachmentID &= ~ATTACHMENT_ADD; + } + LLViewerJointAttachment* attachment = get_if_there(mAttachmentPoints, attachmentID, (LLViewerJointAttachment*)NULL); if (!attachment) -- cgit v1.2.3