diff options
author | Erik Kundiman <erik@megapahit.org> | 2025-03-21 15:41:51 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2025-03-21 15:41:51 +0800 |
commit | 0cdb7d97f67b3a67097e56e71021cb6120ec8a8b (patch) | |
tree | ef3b4a08dd82d137ebe269bdbaedc89b6576511d /indra/newview/llagent.cpp | |
parent | d13a43c74f9c7e450f87edab0bcd9db39ee7c56e (diff) | |
parent | c83e19c467ad055ecaf29989ff80051d32f61c98 (diff) |
Merge branch 'main' into 2025.03
Diffstat (limited to 'indra/newview/llagent.cpp')
-rw-r--r-- | indra/newview/llagent.cpp | 14 |
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() |