diff options
author | Twisted Laws <none@none> | 2011-02-15 14:13:43 -0500 |
---|---|---|
committer | Twisted Laws <none@none> | 2011-02-15 14:13:43 -0500 |
commit | e3f075f77560323e6fb812ca2058d07ccb506044 (patch) | |
tree | f6ea428065be0e8b031b27980fcdf9342a2aa4d8 /indra/newview/llworld.cpp | |
parent | 3555849644ff228a189dd2a21e57def22f142e5d (diff) |
STORM-954 SL-viewer 2.0 No nearby people when over approxiamately 1000 meters
Diffstat (limited to 'indra/newview/llworld.cpp')
-rw-r--r-- | indra/newview/llworld.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 9db6d5e08c..481148ba4e 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -1474,6 +1474,42 @@ void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector<LLVector3d>* positi } } } + // retrieve the list of close avatars from viewer objects as well + // for when we are above 1000m, only do this when we are retrieving + // uuid's too as there could be duplicates + if(avatar_ids != NULL) + { + for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin(); + iter != LLCharacter::sInstances.end(); ++iter) + { + LLVOAvatar* pVOAvatar = (LLVOAvatar*) *iter; + if(pVOAvatar->isDead() || pVOAvatar->isSelf()) + continue; + LLUUID uuid = pVOAvatar->getID(); + if(uuid.isNull()) + continue; + LLVector3d pos_global = pVOAvatar->getPositionGlobal(); + if(dist_vec(pos_global, relative_to) <= radius) + { + bool found = false; + uuid_vec_t::iterator sel_iter = avatar_ids->begin(); + for (; sel_iter != avatar_ids->end(); sel_iter++) + { + if(*sel_iter == uuid) + { + found = true; + break; + } + } + if(!found) + { + if(positions != NULL) + positions->push_back(pos_global); + avatar_ids->push_back(uuid); + } + } + } + } } |