summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerobject.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2014-12-02 14:48:45 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2014-12-02 14:48:45 -0500
commit6cffbfba8b7dd1f6752fb2b4a93265906e9aeb9c (patch)
tree3e4fc80698d063e8fa6d1ee9a652970e04014ecd /indra/newview/llviewerobject.cpp
parent04d9c91a5f27b554e733b77272c8c3afea458810 (diff)
parent4f076daeff1bb626bb90a57cbe91660349ec62f1 (diff)
merge
Diffstat (limited to 'indra/newview/llviewerobject.cpp')
-rwxr-xr-xindra/newview/llviewerobject.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index 690d6aebe2..87424cd584 100755
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -359,10 +359,17 @@ void LLViewerObject::markDead()
//LL_INFOS() << "Marking self " << mLocalID << " as dead." << LL_ENDL;
// Root object of this hierarchy unlinks itself.
+ LLVOAvatar *av = getAvatarAncestor();
if (getParent())
{
((LLViewerObject *)getParent())->removeChild(this);
}
+ LLUUID mesh_id;
+ if (av && LLVOAvatar::getRiggedMeshID(this,mesh_id))
+ {
+ // This case is needed for indirectly attached mesh objects.
+ av->resetJointPositionsOnDetach(mesh_id);
+ }
// Mark itself as dead
mDead = TRUE;
@@ -5015,6 +5022,22 @@ LLVOAvatar* LLViewerObject::asAvatar()
return NULL;
}
+// If this object is directly or indirectly parented by an avatar, return it.
+LLVOAvatar* LLViewerObject::getAvatarAncestor()
+{
+ LLViewerObject *pobj = (LLViewerObject*) getParent();
+ while (pobj)
+ {
+ LLVOAvatar *av = pobj->asAvatar();
+ if (av)
+ {
+ return av;
+ }
+ pobj = (LLViewerObject*) pobj->getParent();
+ }
+ return NULL;
+}
+
BOOL LLViewerObject::isParticleSource() const
{
return !mPartSourcep.isNull() && !mPartSourcep->isDead();