summaryrefslogtreecommitdiff
path: root/indra/newview/llnetmap.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2026-05-21 19:37:15 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2026-05-21 19:37:15 +0300
commit15d82beb6056fa16a1ea1cbf01c5d673a95e0267 (patch)
tree55af7639161926313434d9e4a8b9872369668d5d /indra/newview/llnetmap.cpp
parentff536adef0b74c20f55bd501ad593e4eef762082 (diff)
parent6d4c4c029ce43aa413266135829cd2bc00001890 (diff)
Merge branch 'main' into marchcat/slua-26.2
# Conflicts: # indra/llfilesystem/lldir.cpp # indra/llfilesystem/llfilesystem.cpp # indra/newview/llappviewer.cpp # indra/newview/lltexturecache.cpp # indra/newview/llvoiceclient.cpp # indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml
Diffstat (limited to 'indra/newview/llnetmap.cpp')
-rw-r--r--indra/newview/llnetmap.cpp36
1 files changed, 29 insertions, 7 deletions
diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp
index af472c4259..63ec43458b 100644
--- a/indra/newview/llnetmap.cpp
+++ b/indra/newview/llnetmap.cpp
@@ -47,6 +47,7 @@
#include "llagent.h"
#include "llagentcamera.h"
#include "llappviewer.h" // for gDisconnected
+#include "llavataractions.h"
#include "llcallingcard.h" // LLAvatarTracker
#include "llfloaterland.h"
#include "llfloaterworldmap.h"
@@ -397,20 +398,41 @@ void LLNetMap::draw()
LLWorld::getInstance()->getAvatars(&avatar_ids, &positions, gAgentCamera.getCameraPositionGlobal());
- // Draw avatars
+ std::vector<std::pair<U32, bool>> indexed_avatars;
+ indexed_avatars.reserve(avatar_ids.size());
for (U32 i = 0; i < avatar_ids.size(); i++)
{
- LLUUID uuid = avatar_ids[i];
+ indexed_avatars.emplace_back(i, LLAvatarActions::isFriend(avatar_ids[i]));
+ }
+
+ // Sort avatars so non-friends are drawn first and friend dots will appear on top
+ std::sort(indexed_avatars.begin(), indexed_avatars.end(),
+ [](const auto& a, const auto& b) { return a.second < b.second; });
+
+ uuid_vec_t sorted_avatar_ids;
+ std::vector<LLVector3d> sorted_positions;
+ sorted_avatar_ids.reserve(avatar_ids.size());
+ sorted_positions.reserve(positions.size());
+
+ // Reorder avatar_ids and positions based on sorted indices
+ for (const auto& indexed_avatar : indexed_avatars)
+ {
+ sorted_avatar_ids.push_back(avatar_ids[indexed_avatar.first]);
+ sorted_positions.push_back(positions[indexed_avatar.first]);
+ }
+
+ // Draw avatars
+ for (U32 i = 0; i < sorted_avatar_ids.size(); i++)
+ {
+ LLUUID uuid = sorted_avatar_ids[i];
// Skip self, we'll draw it later
if (uuid == gAgent.getID()) continue;
- pos_map = globalPosToView(positions[i]);
-
- bool show_as_friend = (LLAvatarTracker::instance().getBuddyInfo(uuid) != NULL);
+ pos_map = globalPosToView(sorted_positions[i]);
- LLColor4 color = show_as_friend ? map_avatar_friend_color : map_avatar_color;
+ LLColor4 color = LLAvatarActions::isFriend(uuid) ? map_avatar_friend_color : map_avatar_color;
- unknown_relative_z = positions[i].mdV[VZ] >= COARSEUPDATE_MAX_Z &&
+ unknown_relative_z = sorted_positions[i].mdV[VZ] >= COARSEUPDATE_MAX_Z &&
camera_position.mV[VZ] >= COARSEUPDATE_MAX_Z;
LLWorldMapView::drawAvatar(