diff options
Diffstat (limited to 'indra/newview')
-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); |