summaryrefslogtreecommitdiff
path: root/indra/newview/llvoavatar.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2013-11-18 16:07:55 -0800
committerMerov Linden <merov@lindenlab.com>2013-11-18 16:07:55 -0800
commitce5baf14ac62ecd3bf471e1b49a4e166310ebe1a (patch)
tree110869149fbc439487bb7ae0c49c24b938570b09 /indra/newview/llvoavatar.cpp
parent125f3f071a30f4c47feb664b21f3e380ee4e7e49 (diff)
parentebc9bcbf69f7a519677a6522979a6bf6cbb04bb8 (diff)
Pull merge from lindenlab/viewer-release
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rwxr-xr-xindra/newview/llvoavatar.cpp72
1 files changed, 55 insertions, 17 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 6d29919784..f5918a0a5f 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<LLViewerObject> 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);
}
}
@@ -5959,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