diff options
author | Don Kjer <don@lindenlab.com> | 2011-03-08 01:36:15 +0000 |
---|---|---|
committer | Don Kjer <don@lindenlab.com> | 2011-03-08 01:36:15 +0000 |
commit | 127c45dfbab4550ebd7074f131e3a7b844affea8 (patch) | |
tree | 4e53a71899f03bd8de1028231f025c7355df7f11 /indra/newview/llworld.cpp | |
parent | cb7ae391efed1cadab621734c6eb53fd62df19a4 (diff) | |
parent | a07e6c625108988ad664df70a1842b53c843f223 (diff) |
Merge with viewer-development
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 d9ec41e73a..c09cafc1eb 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -1466,6 +1466,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); + } + } + } + } } |