summaryrefslogtreecommitdiff
path: root/indra/newview/llagent.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2025-03-07 16:44:21 +0800
committerErik Kundiman <erik@megapahit.org>2025-03-07 16:44:21 +0800
commit266e96605781960799dc5388cc1ac168432ff106 (patch)
tree5f46ae7d39a8a954ea9f79dc7216cad6aca2ee6a /indra/newview/llagent.cpp
parent530ff898b00d1759ab4abb32dcf9767960ce7170 (diff)
parentbf949ce004c25917aabddd1cd24be812713e4602 (diff)
Merge branch '2024.12-ForeverFPS'
Diffstat (limited to 'indra/newview/llagent.cpp')
-rw-r--r--indra/newview/llagent.cpp27
1 files changed, 23 insertions, 4 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 26c080bf89..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()
@@ -4879,10 +4889,19 @@ void LLAgent::parseTeleportMessages(const std::string& xml_filename)
LLXMLNodePtr root;
bool success = LLUICtrlFactory::getLayeredXMLNode(xml_filename, root);
- if (!success || !root || !root->hasName( "teleport_messages" ))
+ if (!success)
{
+ LLError::LLUserWarningMsg::showMissingFiles();
LL_ERRS() << "Problem reading teleport string XML file: "
- << xml_filename << LL_ENDL;
+ << xml_filename << LL_ENDL;
+ return;
+ }
+
+ if (!root || !root->hasName("teleport_messages"))
+ {
+ LLError::LLUserWarningMsg::showMissingFiles();
+ LL_ERRS() << "Invalid teleport string XML file: "
+ << xml_filename << LL_ENDL;
return;
}