From ea0df2fbbd0ec44daba5a699e0178236e5bc9168 Mon Sep 17 00:00:00 2001 From: Rye Mutt <rye@alchemyviewer.org> Date: Sun, 31 Oct 2021 16:54:57 -0400 Subject: [PATCH] Small opt to calcNearbyLights --- indra/newview/pipeline.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 3c50cc15789..7045e6d6b1f 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -6249,13 +6249,17 @@ void LLPipeline::calcNearbyLights(LLCamera& camera) { LLDrawable* drawable = light.drawable; const LLViewerObject *vobj = light.drawable->getVObj(); - if(vobj && vobj->getAvatar() - && (vobj->getAvatar()->isTooComplex() || vobj->getAvatar()->isInMuteList()) - ) - { - drawable->clearState(LLDrawable::NEARBY_LIGHT); - continue; - } + if (vobj) + { + if (LLVOAvatar* avatarp = vobj->getAvatar()) + { + if (avatarp->isTooComplex() || avatarp->isInMuteList()) + { + drawable->clearState(LLDrawable::NEARBY_LIGHT); + continue; + } + } + } LLVOVolume* volight = drawable->getVOVolume(); if (!volight || !drawable->isState(LLDrawable::LIGHT)) -- GitLab