From 8259cdb53265dd35097a0342455512bafc0426a7 Mon Sep 17 00:00:00 2001 From: Rye Mutt <rye@alchemyviewer.org> Date: Thu, 28 Jan 2021 19:55:40 -0500 Subject: [PATCH] Fix top objects teleport/beacon --- indra/newview/llfloatertopobjects.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/indra/newview/llfloatertopobjects.cpp b/indra/newview/llfloatertopobjects.cpp index 143edb7c464..9b19f6f4743 100644 --- a/indra/newview/llfloatertopobjects.cpp +++ b/indra/newview/llfloatertopobjects.cpp @@ -514,10 +514,11 @@ void LLFloaterTopObjects::showBeacon() std::string name = first_selected->getColumn(1)->getValue().asString(); std::string pos_string = first_selected->getColumn(3)->getValue().asString(); - LLVector3 pos_agent; - S32 count = sscanf(pos_string.c_str(), "%f %f %f", pos_agent.mV + 0, pos_agent.mV + 1, pos_agent.mV + 2); - if (count != 3) return; + 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); LLTracker::trackLocation(pos_global, name, std::string(), LLTracker::LOCATION_ITEM); } @@ -542,11 +543,14 @@ void LLFloaterTopObjects::onTeleportTo() std::string pos_string = first_selected->getColumn(3)->getValue().asString(); - LLVector3 pos_agent; - S32 count = sscanf(pos_string.c_str(), "%f %f %f", pos_agent.mV + 0, pos_agent.mV + 1, pos_agent.mV + 2); - if (count != 3) return; + F32 x, y, z; + S32 matched = sscanf(pos_string.c_str(), "<%g,%g,%g>", &x, &y, &z); + if (matched != 3) return; - gAgent.teleportViaLocation(gAgent.getPosGlobalFromAgent(pos_agent)); + LLVector3 pos_agent(x, y, z); + LLVector3d pos_global = gAgent.getPosGlobalFromAgent(pos_agent); + + gAgent.teleportViaLocation(pos_global); } void LLFloaterTopObjects::onEstateKick() -- GitLab