From 5275f7e852d7ab6dab11c4d96489af8840e97f87 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Sun, 3 Aug 2014 18:52:06 -0500 Subject: [PATCH] Re-determine spatial groups for hud attachments upon teleport. Fixes missing prim issue. --- indra/newview/llvoavatarself.cpp | 23 +++++++++++++++++++++++ indra/newview/llvoavatarself.h | 5 +++++ 2 files changed, 28 insertions(+) diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 6f0a4bd9f..90f28539b 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;