diff options
Diffstat (limited to 'indra/newview/llvoavatarself.cpp')
-rw-r--r-- | indra/newview/llvoavatarself.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index fd519cb3a9..0298bcc80b 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -62,6 +62,8 @@ #include "llviewerstats.h" #include "llviewerregion.h" #include "llappearancemgr.h" +#include "llmeshrepository.h" +#include "llvovolume.h" #if LL_MSVC // disable boost::lexical_cast warning @@ -655,6 +657,10 @@ LLJoint *LLVOAvatarSelf::getJoint(const std::string &name) return LLVOAvatar::getJoint(name); } +void LLVOAvatarSelf::resetJointPositions( void ) +{ + return LLVOAvatar::resetJointPositionsToDefault(); +} // virtual BOOL LLVOAvatarSelf::setVisualParamWeight(LLVisualParam *which_param, F32 weight, BOOL upload_bake ) { @@ -1119,8 +1125,22 @@ const LLViewerJointAttachment *LLVOAvatarSelf::attachObject(LLViewerObject *view BOOL LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object) { const LLUUID attachment_id = viewer_object->getAttachmentItemID(); - if (LLVOAvatar::detachObject(viewer_object)) + if ( LLVOAvatar::detachObject(viewer_object) ) { + //If a VO has a skin that we'll reset the joint positions to their default + if ( viewer_object->mDrawable ) + { + LLVOVolume* pVObj = viewer_object->mDrawable->getVOVolume(); + if ( pVObj ) + { + const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( pVObj->getVolume()->getParams().getSculptID() ); + if ( pSkinData ) + { + resetJointPositions(); + } + } + } + // the simulator should automatically handle permission revocation stopMotionFromSource(attachment_id); |