summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Nikolenko <maximnproductengine@lindenlab.com>2025-02-26 15:35:04 +0200
committerGitHub <noreply@github.com>2025-02-26 15:35:04 +0200
commitbc02334284839e6e7fb133d8b5b4d75fec919691 (patch)
tree2506d81f43673d48172237f60c7010c93a87cca0
parentca079bc14911ddca631167e078deab6d35224f23 (diff)
#3270 use TELEPORT_LOCAL when teleporting within a region via landmark
-rw-r--r--indra/newview/llagent.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 8756baa04a..dde4555770 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -56,6 +56,7 @@
#include "llgroupmgr.h"
#include "llhudmanager.h"
#include "lljoystickbutton.h"
+#include "lllandmarkactions.h"
#include "llmorphview.h"
#include "llmoveview.h"
#include "llnavigationbar.h" // to show/hide navigation bar when changing mouse look state
@@ -4317,8 +4318,17 @@ void LLAgent::teleportViaLandmark(const LLUUID& landmark_asset_id)
void LLAgent::doTeleportViaLandmark(const LLUUID& landmark_asset_id)
{
- LLViewerRegion *regionp = getRegion();
- if(regionp && teleportCore())
+ bool is_local(false);
+ LLViewerRegion* regionp = getRegion();
+
+ if (LLLandmark* landmark = gLandmarkList.getAsset(landmark_asset_id, NULL))
+ {
+ LLVector3d pos_global;
+ landmark->getGlobalPos(pos_global);
+ is_local = (regionp->getHandle() == to_region_handle_global((F32)pos_global.mdV[VX], (F32)pos_global.mdV[VY]));
+ }
+
+ if(regionp && teleportCore(is_local))
{
LL_INFOS("Teleport") << "Sending TeleportLandmarkRequest. Current region handle " << regionp->getHandle()
<< " region id " << regionp->getRegionID()