summaryrefslogtreecommitdiff
path: root/indra/newview/llagent.cpp
diff options
context:
space:
mode:
authorMaxim Nikolenko <mnikolenko@productengine.com>2025-03-11 11:17:50 +0200
committerGitHub <noreply@github.com>2025-03-11 11:17:50 +0200
commit716e09cffeea638f3fa26737d33ba1c4c3532473 (patch)
tree954d99d460659a03ba104d95a95f14c9d1f03b79 /indra/newview/llagent.cpp
parent8d00744998419edc4726ad57c874e6fa7415c80c (diff)
parent2648d5cdc8a725f4cb4924fa31ae20c82a860a34 (diff)
Merge pull request #3707 from secondlife/maxim/2025.03
Merge branch 'main' into release/2025.03
Diffstat (limited to 'indra/newview/llagent.cpp')
-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 a076594e0a..ed82f1db48 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
@@ -4320,8 +4321,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()