diff options
Diffstat (limited to 'indra/newview/llavatarlist.cpp')
-rw-r--r-- | indra/newview/llavatarlist.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 3bd4f898c8..71b23e1383 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -33,6 +33,7 @@ #include "llviewerprecompiledheaders.h" #include "llavatarlist.h" +#include "llagent.h" // for comparator // newview #include "llcallingcard.h" // for LLAvatarTracker @@ -420,3 +421,17 @@ bool LLAvatarItemNameComparator::doCompare(const LLAvatarListItem* avatar_item1, return name1 < name2; } +bool LLAvatarItemAgentOnTopComparator::doCompare(const LLAvatarListItem* avatar_item1, const LLAvatarListItem* avatar_item2) const +{ + //keep agent on top, if first is agent, + //then we need to return true to elevate this id, otherwise false. + if(avatar_item1->getAvatarId() == gAgent.getID()) + { + return true; + } + else if (avatar_item2->getAvatarId() == gAgent.getID()) + { + return false; + } + return LLAvatarItemNameComparator::doCompare(avatar_item1,avatar_item2); +} |