From 23960d2d9491f756bb844529f85a8a612a2ddb90 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Tue, 13 Feb 2018 19:01:07 +0200 Subject: MAINT-8290 Don't render particles attached to the muted avatars --- indra/newview/llviewerpartsource.cpp | 28 ++++++++++++++++++++++++++++ indra/newview/llviewerpartsource.h | 2 ++ 2 files changed, 30 insertions(+) (limited to 'indra/newview') 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 mOwnerAvatarp; LLPointer mImagep; // Particle information U32 mPartFlags; // Flags for the particle -- cgit v1.2.3