diff options
author | Leyla Farazha <leyla@lindenlab.com> | 2010-05-28 13:27:30 -0700 |
---|---|---|
committer | Leyla Farazha <leyla@lindenlab.com> | 2010-05-28 13:27:30 -0700 |
commit | 9874e4d1818661580d72f41a507b41d3e07aecd5 (patch) | |
tree | d587e93308ce422d7b19671a9278d7257a0a3b8c /indra/newview/llfloateravatarpicker.cpp | |
parent | 9bb097000cdd38f3af5152ba81731ff093865ffe (diff) |
fixed nearby and friends avatar picker bug
Diffstat (limited to 'indra/newview/llfloateravatarpicker.cpp')
-rw-r--r-- | indra/newview/llfloateravatarpicker.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index d9c580320a..b533e394ff 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -177,7 +177,20 @@ static void getSelectedAvatarData(const LLScrollListCtrl* from, uuid_vec_t& avat if (item->getUUID().notNull()) { avatar_ids.push_back(item->getUUID()); - avatar_names.push_back(sAvatarNameMap[item->getUUID()]); + + std::map<LLUUID, LLAvatarName>::iterator iter = sAvatarNameMap.find(item->getUUID()); + if (iter != sAvatarNameMap.end()) + { + avatar_names.push_back(iter->second); + } + else + { + // the only case where it isn't in the name map is friends + // but it should be in the name cache + LLAvatarName av_name; + LLAvatarNameCache::get(item->getUUID(), &av_name); + avatar_names.push_back(av_name); + } } } } @@ -280,6 +293,8 @@ void LLFloaterAvatarPicker::populateNearMe() element["columns"][0]["value"] = av_name.mDisplayName; element["columns"][1]["column"] = "username"; element["columns"][1]["value"] = av_name.mUsername; + + sAvatarNameMap[av] = av_name; } near_me_scroller->addElement(element); empty = FALSE; @@ -314,7 +329,6 @@ void LLFloaterAvatarPicker::populateFriend() LLAvatarTracker::instance().applyFunctor(collector); LLCollectAllBuddies::buddy_map_t::iterator it; - for(it = collector.mOnline.begin(); it!=collector.mOnline.end(); it++) { friends_scroller->addStringUUIDItem(it->first, it->second); |