diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 84453cb2c..f5cf396c3 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -54,6 +54,7 @@ #include "llviewermedia.h" #include "llviewermenu.h" #include "llviewerobjectlist.h" +#include "llviewerparcelmgr.h" #include "llviewerstats.h" #include "llviewerregion.h" #include "llviewertexlayer.h" @@ -180,6 +181,8 @@ LLVOAvatarSelf::LLVOAvatarSelf(const LLUUID& id, SHClientTagMgr::instance().updateAvatarTag(this); //No TE update messages for self. Force update here. + mTeleportFinishedSlot = LLViewerParcelMgr::getInstance()->setTeleportFinishedCallback(boost::bind(&LLVOAvatarSelf::handleTeleportFinished, this)); + lldebugs << "Marking avatar as self " << id << llendl; } @@ -3289,3 +3292,23 @@ void LLVOAvatarSelf::setInvisible(bool invisible) gAgent.sendAgentSetAppearance(); } } + +void LLVOAvatarSelf::handleTeleportFinished() +{ + for (attachment_map_t::iterator it = mAttachmentPoints.begin(); it != mAttachmentPoints.end(); ++it) + { + LLViewerJointAttachment* attachment = it->second; + if (attachment && attachment->getIsHUDAttachment()) + { + typedef LLViewerJointAttachment::attachedobjs_vec_t object_vec_t; + const object_vec_t& obj_list = attachment->mAttachedObjects; + for (object_vec_t::const_iterator it2 = obj_list.begin(); it2 != obj_list.end(); ++it2) + { + if(*it2) + { + (*it2)->dirtySpatialGroup(true); + } + } + } + } +} diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 2c9d69b8b..fea466775 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -429,6 +429,11 @@ private: public: static void onChangeSelfInvisible(bool invisible); void setInvisible(bool invisible); +private: + void handleTeleportFinished(); +private: + boost::signals2::connection mTeleportFinishedSlot; + }; extern LLPointer gAgentAvatarp;