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 -_-) --- ChangeLog.txt | 6 ++++++ linden/indra/newview/llfloatermap.cpp | 25 +++++++++++++++++++------ 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 89920a8..5a4670d 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,5 +1,11 @@ 2009-10-19 McCabe Maxsted + * Partial fix for avatar names not displaying at > 1024m + (won't be fixed until LL actually sends height in more than one byte -_-) + + modified: linden/indra/newview/llfloatermap.cpp + + * Clamp map teleporting at 4096 rather than 1000. modified: linden/indra/newview/llfloaterworldmap.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