Skip to content

Commit 9bbb572

Browse files
authored
Merge pull request #14 from afallenhope/FLN-fix-people-nearby-panel
FLN: Nearby List Fix
2 parents 60f40ab + 5b1d0e3 commit 9bbb572

2 files changed

Lines changed: 21 additions & 3 deletions

File tree

indra/newview/llpanelpeople.cpp

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -894,13 +894,31 @@ void LLPanelPeople::updateNearbyList()
894894
// [/RLVa:KB]
895895
LLWorld::getInstance()->getAvatars(&mNearbyList->getIDs(), &positions, gAgent.getPositionGlobal(), ALControlCache::NearMeRange);
896896

897+
int count_in_region = 0;
897898
LLViewerRegion* cur_region = gAgent.getRegion();
898-
mNearbyCountText->setTextArg("[COUNT]", std::to_string(mNearbyList->size()));
899899

900-
if (cur_region)
900+
if (!cur_region)
901+
{
902+
LL_WARNS() << "Current region is null" << LL_ENDL;
903+
return;
904+
}
905+
906+
// Iterate through avatars in the region.
907+
// The nearby list reports the avatars in 4096m range (ALControlCache::NearMeRange)
908+
// Reported UUIDs may not be in same region.
909+
// Also the TOTAL changes based on your filter results --FLN
910+
for (size_t i = 0; i < positions.size(); ++i)
901911
{
902912
mNearbyCountText->setTextArg("[REGION]", cur_region->getName());
913+
if (cur_region->pointInRegionGlobal(positions[i]))
914+
{
915+
count_in_region++;
916+
}
903917
}
918+
919+
mNearbyCountText->setTextArg("[TOTAL]", std::to_string(mNearbyList->size()));
920+
mNearbyCountText->setTextArg("[COUNT]", std::to_string(count_in_region));
921+
mNearbyCountText->setTextArg("[REGION]", RlvActions::canShowLocation() ? cur_region->getName() : "[REDACTED]");
904922
// [RLVa:KB] - Checked: RLVa-2.0.3
905923
}
906924
else

indra/newview/skins/default/xui/en/panel_people.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ Learn about [https://community.secondlife.com/knowledgebase/joining-and-particip
184184
use_ellipses="true"
185185
skip_link_underline="true"
186186
name="nearbycount">
187-
There are [COUNT] avatars in [REGION].
187+
There are [TOTAL] avatars total and [COUNT] in [REGION].
188188
</text>
189189
<layout_stack
190190
clip="false"

0 commit comments

Comments
 (0)