From 3c464b4d8bb9bed58edc0418a8c91e8a609b5160 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 31 Jul 2025 23:39:09 +0800 Subject: Optimise arrival & departure notifications by not having extra calls to getAvatars. The avatars' positions member had to be moved to an object that is accessible from VOAvatar too, and that would be the global Agent. It makes sense too, that it's the object that keeps the positions of other agents. It even has a section for positions too. --- indra/newview/llavatarlist.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'indra/newview/llavatarlist.cpp') diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 834288a93e..e29be0c757 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -186,12 +186,6 @@ std::string LLAvatarList::getAvatarName(LLAvatarName av_name) return mShowCompleteName? av_name.getCompleteName(false, mForceCompleteName) : av_name.getDisplayName(); } -void LLAvatarList::setAvatarsPositions(const std::map& avatarsPositions) -{ - mAvatarsPositions.clear(); - mAvatarsPositions = avatarsPositions; -} - // virtual void LLAvatarList::draw() { @@ -224,7 +218,10 @@ void LLAvatarList::draw() item->setAvatarArrivalTime(secs_since); } if (mAvatarDistance) - item->setAvatarDistance(dist_vec(mAvatarsPositions[item->getAvatarId()], gAgent.getPositionGlobal())); + { + auto avatarsPositions = gAgent.getAvatarsPositions(); + item->setAvatarDistance(dist_vec(avatarsPositions[item->getAvatarId()], gAgent.getPositionGlobal())); + } } } if (mShowLastInteractionTime) -- cgit v1.2.3