From 4ddac28142865a687ca611205f2def09cc0e5d1d Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Fri, 8 Mar 2019 13:38:38 -0500 Subject: [PATCH] Code cleanup --- indra/newview/llfloatertopobjects.cpp | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/indra/newview/llfloatertopobjects.cpp b/indra/newview/llfloatertopobjects.cpp index ecde6b5b5..82206513b 100644 --- a/indra/newview/llfloatertopobjects.cpp +++ b/indra/newview/llfloatertopobjects.cpp @@ -495,23 +495,11 @@ void LLFloaterTopObjects::onGetByParcelName() void LLFloaterTopObjects::showBeacon() { - LLScrollListCtrl* list = getChild("objects_list"); - if (!list) return; - - LLScrollListItem* first_selected = list->getFirstSelected(); - if (!first_selected) return; - + LLVector3d pos_global = getSelectedPosition(); + if (pos_global.isExactlyZero()) return; + LLScrollListItem* first_selected = getChild("objects_list")->getFirstSelected(); std::string name = first_selected->getColumn(1)->getValue().asString(); - std::string pos_string = first_selected->getColumn(3)->getValue().asString(); - - F32 x, y, z; - S32 matched = sscanf(pos_string.c_str(), "<%g,%g,%g>", &x, &y, &z); - if (matched != 3) return; - - LLVector3 pos_agent(x, y, z); - LLVector3d pos_global = gAgent.getPosGlobalFromAgent(pos_agent); - std::string tooltip(""); - LLTracker::trackLocation(pos_global, name, tooltip, LLTracker::LOCATION_ITEM); + LLTracker::trackLocation(pos_global, name, LLStringUtil::null, LLTracker::LOCATION_ITEM); const LLUUID& taskid = first_selected->getUUID(); if(LLVOAvatar* voavatar = gObjectList.findAvatar(taskid))