diff options
author | Anchor Linden <anchor@lindenlab.com> | 2018-05-21 16:47:42 -0700 |
---|---|---|
committer | Anchor Linden <anchor@lindenlab.com> | 2018-05-21 16:47:42 -0700 |
commit | 0fdbe7e34df55ac92302b4af38c42d03454d3bc1 (patch) | |
tree | 038c6087299c9096ac7c6606ec45a8339eb0fd72 /indra/newview/llviewerpartsource.cpp | |
parent | 3bf89821d9c9777a0f24d89280bd7a7011a7a3df (diff) | |
parent | c70119ebabc4b06e2b0db02aea8c56e01fbc666e (diff) |
Merge
Diffstat (limited to 'indra/newview/llviewerpartsource.cpp')
-rw-r--r-- | indra/newview/llviewerpartsource.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/indra/newview/llviewerpartsource.cpp b/indra/newview/llviewerpartsource.cpp index 814060f4f2..998ae52fe0 100644 --- a/indra/newview/llviewerpartsource.cpp +++ b/indra/newview/llviewerpartsource.cpp @@ -40,6 +40,25 @@ #include "llworld.h" #include "pipeline.h" + +static LLVOAvatar* find_avatar(const LLUUID& id) +{ + LLViewerObject *obj = gObjectList.findObject(id); + while (obj && obj->isAttachment()) + { + obj = (LLViewerObject *)obj->getParent(); + } + + if (obj && obj->isAvatar()) + { + return (LLVOAvatar*)obj; + } + else + { + return NULL; + } +} + LLViewerPartSource::LLViewerPartSource(const U32 type) : mType(type), mOwnerUUID(LLUUID::null), @@ -113,6 +132,15 @@ void LLViewerPartSourceScript::update(const F32 dt) if( mIsSuspended ) return; + if (mOwnerAvatarp.isNull() && mOwnerUUID != LLUUID::null) + { + mOwnerAvatarp = find_avatar(mOwnerUUID); + } + if (mOwnerAvatarp.notNull() && LLVOAvatar::AV_DO_NOT_RENDER == mOwnerAvatarp->getVisualMuteSettings()) + { + return; + } + F32 old_update_time = mLastUpdateTime; mLastUpdateTime += dt; |