From 913e55b5ce4c5e018d18678b9a78b06541976da1 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 16 Oct 2013 12:06:42 -0700 Subject: MAINT-3312 : crash in LLVOAvatar::lazyAttach(). Reverted some earlier changes --- indra/newview/llvoavatar.cpp | 50 +++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 17 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 6d29919784..f92fa0371e 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5523,7 +5523,12 @@ void LLVOAvatar::addChild(LLViewerObject *childp) { if (!attachObject(childp)) { - mPendingAttachment.push_back(childp); + llwarns << "addChild() failed for " + << childp->getID() + << " item " << childp->getAttachmentItemID() + << llendl; + // MAINT-3312 backout + // mPendingAttachment.push_back(childp); } } else @@ -5557,21 +5562,26 @@ LLViewerJointAttachment* LLVOAvatar::getTargetAttachmentPoint(LLViewerObject* vi if (!attachment) { - llwarns << "Object attachment point invalid: " << attachmentID << llendl; + llwarns << "Object attachment point invalid: " << attachmentID + << " trying to use 1 (chest)" + << llendl; - for (int i = 0; i < 15 && !attachment; i++) + attachment = get_if_there(mAttachmentPoints, 1, (LLViewerJointAttachment*)NULL); // Arbitrary using 1 (chest) + if (attachment) { - attachment = get_if_there(mAttachmentPoints, i, (LLViewerJointAttachment*)NULL); // Arbitrary using 1 (chest) - - if (attachment) - { - llwarns << "Object attachment point falling back to : " << i << llendl; - } + llwarns << "Object attachment point invalid: " << attachmentID + << " on object " << viewer_object->getID() + << " attachment item " << viewer_object->getAttachmentItemID() + << " falling back to 1 (chest)" + << llendl; } - - if (!attachment) + else { - llerrs << "Could not find any object attachment point for: " << attachmentID << llendl; + llwarns << "Object attachment point invalid: " << attachmentID + << " on object " << viewer_object->getID() + << " attachment item " << viewer_object->getAttachmentItemID() + << "Unable to use fallback attachment point 1 (chest)" + << llendl; } } @@ -5643,16 +5653,22 @@ void LLVOAvatar::lazyAttach() for (U32 i = 0; i < mPendingAttachment.size(); i++) { - if (mPendingAttachment[i]->mDrawable) + LLPointer cur_attachment = mPendingAttachment[i]; + if (cur_attachment->mDrawable) { - if (!attachObject(mPendingAttachment[i])) - { - still_pending.push_back(mPendingAttachment[i]); + if (!attachObject(cur_attachment)) + { // Drop it + llwarns << "attachObject() failed for " + << cur_attachment->getID() + << " item " << cur_attachment->getAttachmentItemID() + << llendl; + // MAINT-3312 backout + //still_pending.push_back(cur_attachment); } } else { - still_pending.push_back(mPendingAttachment[i]); + still_pending.push_back(cur_attachment); } } -- cgit v1.2.3 From 8eb56668feb91032136ccfabee44c3ceb1d586b3 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 17 Oct 2013 14:58:27 -0700 Subject: SUN-69 MAINT-2258 : temp attachments getting removed improperly. Reviewed by Kelly. --- indra/newview/llvoavatar.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index f92fa0371e..f5918a0a5f 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5975,6 +5975,28 @@ BOOL LLVOAvatar::isWearingWearableType(LLWearableType::EType type) const +LLViewerObject * LLVOAvatar::findAttachmentByID( const LLUUID & target_id ) const +{ + for(attachment_map_t::const_iterator attachment_points_iter = mAttachmentPoints.begin(); + attachment_points_iter != gAgentAvatarp->mAttachmentPoints.end(); + ++attachment_points_iter) + { + LLViewerJointAttachment* attachment = attachment_points_iter->second; + for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); + attachment_iter != attachment->mAttachedObjects.end(); + ++attachment_iter) + { + LLViewerObject *attached_object = (*attachment_iter); + if (attached_object && + attached_object->getID() == target_id) + { + return attached_object; + } + } + } + + return NULL; +} // virtual -- cgit v1.2.3