Muting an avatar now also removes their attached lights. Also cleaned up light update code(no change in behavior)

This commit is contained in:
Shyotl
2012-10-22 03:07:07 -05:00
parent d2004e88f9
commit 9ef10b1663
3 changed files with 64 additions and 28 deletions

View File

@@ -295,6 +295,23 @@ BOOL LLMuteList::isLinden(const std::string& name) const
return last_name == "Linden";
}
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;
}
}
BOOL LLMuteList::add(const LLMute& mute, U32 flags)
{
@@ -391,6 +408,12 @@ BOOL LLMuteList::add(const LLMute& mute, U32 flags)
LLViewerPartSim::getInstance()->clearParticlesByOwnerID(localmute.mID);
}
}
//mute local lights that are attached to the avatar
LLVOAvatar *avatarp = find_avatar(localmute.mID);
if (avatarp)
{
LLPipeline::removeMutedAVsLights(avatarp);
}
return TRUE;
}
}