From 95b78d58fa6e1f18160fb42252d2f6b0e87ca372 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Mon, 19 Oct 2009 21:06:17 -0700 Subject: Partial fix for avatar names not displaying at > 1024m (won't be fixed until LL actually sends height in more than one byte -_-) --- linden/indra/newview/llfloatermap.cpp | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'linden/indra/newview/llfloatermap.cpp') diff --git a/linden/indra/newview/llfloatermap.cpp b/linden/indra/newview/llfloatermap.cpp index 31e57a0..3807a90 100644 --- a/linden/indra/newview/llfloatermap.cpp +++ b/linden/indra/newview/llfloatermap.cpp @@ -279,12 +279,25 @@ void LLFloaterMap::populateRadar() // [/RLVa:KB] // check if they're in certain ranges and notify user if we've enabled that - LLVector3d temp = positions[i] - current_pos; - F32 distance = llround((F32)temp.magVec(), 0.1f); - /*char dist[32]; - sprintf(dist, "%.1f", distance); - std::string dist_string = dist;*/ - std::string dist_string = llformat("%.1f", distance); + LLVector3d temp = positions[i]; + if (positions[i].mdV[VZ] == 0.0f) // LL only sends height value up to 1024m, try to work around it + { + LLViewerObject *av_obj = gObjectList.findObject(avatar_ids[i]); + if (av_obj != NULL && av_obj->isAvatar()) + { + LLVOAvatar* avatarp = (LLVOAvatar*)av_obj; + if (avatarp != NULL) + { + temp = avatarp->getPositionGlobal(); + } + } + } + F64 distance = dist_vec(temp, current_pos); + // we round for accuracy when avs tp in + std::string dist_string = llformat("%.1f", llround((F32)distance, 0.1f)); + + /*llinfos << "Avatar :" << fullname << " Position: " << positions[i] << " Your Position: " + << current_pos << " Distance: " << distance << llendl;*/ if (notify_chat) { -- cgit v1.1