From 9a2ff0daa170b91ee0126bb5499be83355e90beb Mon Sep 17 00:00:00 2001 From: Hecklezz Date: Thu, 22 May 2025 18:01:56 +1000 Subject: [PATCH] Make sure only a single teleport history region request can occur at once --- indra/newview/llteleporthistory.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/indra/newview/llteleporthistory.cpp b/indra/newview/llteleporthistory.cpp index 3dec10c61c..3c20615a24 100644 --- a/indra/newview/llteleporthistory.cpp +++ b/indra/newview/llteleporthistory.cpp @@ -121,6 +121,13 @@ void LLTeleportHistory::goToItem(int idx) slurl = LLSLURL(gatekeeper + ":" + slurl.getRegion(), slurl.getPosition(), true); } + if (mRequestedItem != -1) + { + return; // We already have a request in progress and don't want to spam the server + } + + mRequestedItem = idx; + LLWorldMapMessage::getInstance()->sendNamedRegionRequest( slurl.getRegion(), boost::bind(&LLTeleportHistory::regionNameCallback, this, idx, _1, _2, _3, _4), @@ -344,7 +351,7 @@ void LLTeleportHistory::dump() const // [FIRE-35355] Callback for OpenSim so we can teleport to the correct global position on another grid void LLTeleportHistory::regionNameCallback(int idx, U64 region_handle, const LLSLURL& slurl, const LLUUID& snapshot_id, bool teleport) { - if (slurl.getType() == LLSLURL::LOCATION) + if (region_handle) { // Sanity checks again just in case since time has passed since the request was made if (idx < 0 || idx >= (int)mItems.size()) @@ -364,11 +371,11 @@ void LLTeleportHistory::regionNameCallback(int idx, U64 region_handle, const LLS // Attempt to teleport to the target grids region gAgent.teleportViaLocation(global_pos); - mRequestedItem = idx; } else { - LL_WARNS() << "Invalid teleport history slurl type: " << slurl.getType() << LL_ENDL; + LL_WARNS() << "Invalid teleport history region handle" << LL_ENDL; + onTeleportFailed(); } } //