diff --git a/indra/llappearance/llavatarjointmesh.cpp b/indra/llappearance/llavatarjointmesh.cpp index 8727839ba..2cfcac4c1 100644 --- a/indra/llappearance/llavatarjointmesh.cpp +++ b/indra/llappearance/llavatarjointmesh.cpp @@ -128,11 +128,11 @@ BOOL LLSkinJoint::setupSkinJoint( LLJoint *joint) } // compute the inverse root skin matrix - mRootToJointSkinOffset = totalSkinOffset((LLAvatarJoint*)joint); + mRootToJointSkinOffset = totalSkinOffset(mJoint); mRootToJointSkinOffset = -mRootToJointSkinOffset; //mRootToParentJointSkinOffset = totalSkinOffset((LLAvatarJoint*)joint->getParent()); - mRootToParentJointSkinOffset = totalSkinOffset(getBaseSkeletonAncestor((LLAvatarJoint*)joint)); + mRootToParentJointSkinOffset = totalSkinOffset(getBaseSkeletonAncestor(mJoint)); mRootToParentJointSkinOffset = -mRootToParentJointSkinOffset; return TRUE; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index dcbdeb2da..8fe98b50c 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7762,6 +7762,13 @@ const LLViewerJointAttachment *LLVOAvatar::attachObject(LLViewerObject *viewer_o << (item ? item->getName() : "UNKNOWN") << " id " << item_id << LL_ENDL; return 0; } + + // The object can already exist in the vector if it was attached while was already attached (causing a re-attach). + std::pair const val(viewer_object, attachment); + if (std::find(mAttachedObjectsVector.begin(), mAttachedObjectsVector.end(), val) == mAttachedObjectsVector.end()) + { + mAttachedObjectsVector.push_back(val); + } if (!viewer_object->isAnimatedObject()) { @@ -7776,13 +7783,6 @@ const LLViewerJointAttachment *LLVOAvatar::attachObject(LLViewerObject *viewer_o LLSelectMgr::getInstance()->updatePointAt(); } - // The object can already exist in the vector if it was attached while was already attached (causing a re-attach). - std::pair const val(viewer_object, attachment); - if (std::find(mAttachedObjectsVector.begin(), mAttachedObjectsVector.end(), val) == mAttachedObjectsVector.end()) - { - mAttachedObjectsVector.push_back(val); - } - return attachment; }