diff options
author | AndreyL ProductEngine <none@none> | 2018-02-13 19:01:07 +0200 |
---|---|---|
committer | AndreyL ProductEngine <none@none> | 2018-02-13 19:01:07 +0200 |
commit | 23960d2d9491f756bb844529f85a8a612a2ddb90 (patch) | |
tree | e02157e8094637e9a09f4c523497535aff304a82 /indra | |
parent | 8f65593786a4302a1ef7c95ce048bd658367a220 (diff) |
MAINT-8290 Don't render particles attached to the muted avatars
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llviewerpartsource.cpp | 28 | ||||
-rw-r--r-- | indra/newview/llviewerpartsource.h | 2 |
2 files changed, 30 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; diff --git a/indra/newview/llviewerpartsource.h b/indra/newview/llviewerpartsource.h index 12e926173b..504229e81f 100644 --- a/indra/newview/llviewerpartsource.h +++ b/indra/newview/llviewerpartsource.h @@ -42,6 +42,7 @@ class LLViewerTexture; class LLViewerObject; class LLViewerPart; +class LLVOAvatar; class LLViewerPartSource : public LLRefCount { @@ -85,6 +86,7 @@ protected: F32 mLastUpdateTime; F32 mLastPartTime; LLUUID mOwnerUUID; + LLPointer<LLVOAvatar> mOwnerAvatarp; LLPointer<LLViewerTexture> mImagep; // Particle information U32 mPartFlags; // Flags for the particle |