summaryrefslogtreecommitdiff
path: root/indra/newview/llvoavatar.cpp
diff options
context:
space:
mode:
authorGlenn Glazer <coyot@lindenlab.com>2015-10-01 09:02:45 -0700
committerGlenn Glazer <coyot@lindenlab.com>2015-10-01 09:02:45 -0700
commitd3928405e3498fabd9215da96fcd0d72e71e83e1 (patch)
tree218b97ae3d0173a9b8c106c09306aef03f42c7f6 /indra/newview/llvoavatar.cpp
parentc1e3f778cb377999edf49764088f3f23a2302afc (diff)
parent6c422a881499c0d7649a59db47905a584bbd2bc1 (diff)
merge, close develop branch
--HG-- branch : develop
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rwxr-xr-xindra/newview/llvoavatar.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index f753448770..202b63dec0 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -5153,7 +5153,10 @@ void LLVOAvatar::clearAttachmentPosOverrides()
for (; iter != end; ++iter)
{
LLJoint* pJoint = (*iter);
- pJoint->clearAttachmentPosOverrides();
+ if (pJoint)
+ {
+ pJoint->clearAttachmentPosOverrides();
+ }
}
}
@@ -5435,8 +5438,14 @@ BOOL LLVOAvatar::loadSkeletonNode ()
LLViewerJointAttachment* attachment = new LLViewerJointAttachment();
attachment->setName(info->mName);
- LLJoint *parentJoint = getJoint(info->mJointName);
- if (!parentJoint)
+ LLJoint *parent_joint = getJoint(info->mJointName);
+ if (!parent_joint)
+ {
+ // If the intended location for attachment point is unavailable, stick it in a default location.
+ LL_INFOS() << "attachment pt " << info->mName << " using mPelvis as default parent" << LL_ENDL;
+ parent_joint = getJoint("mPelvis");
+ }
+ if (!parent_joint)
{
LL_WARNS() << "No parent joint by name " << info->mJointName << " found for attachment point " << info->mName << LL_ENDL;
delete attachment;
@@ -5491,7 +5500,7 @@ BOOL LLVOAvatar::loadSkeletonNode ()
mAttachmentPoints[attachmentID] = attachment;
// now add attachment joint
- parentJoint->addChild(attachment);
+ parent_joint->addChild(attachment);
}
}