Skip to content

Commit bc02334

Browse files
#3270 use TELEPORT_LOCAL when teleporting within a region via landmark
1 parent ca079bc commit bc02334

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

indra/newview/llagent.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
#include "llgroupmgr.h"
5757
#include "llhudmanager.h"
5858
#include "lljoystickbutton.h"
59+
#include "lllandmarkactions.h"
5960
#include "llmorphview.h"
6061
#include "llmoveview.h"
6162
#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)
43174318

43184319
void LLAgent::doTeleportViaLandmark(const LLUUID& landmark_asset_id)
43194320
{
4320-
LLViewerRegion *regionp = getRegion();
4321-
if(regionp && teleportCore())
4321+
bool is_local(false);
4322+
LLViewerRegion* regionp = getRegion();
4323+
4324+
if (LLLandmark* landmark = gLandmarkList.getAsset(landmark_asset_id, NULL))
4325+
{
4326+
LLVector3d pos_global;
4327+
landmark->getGlobalPos(pos_global);
4328+
is_local = (regionp->getHandle() == to_region_handle_global((F32)pos_global.mdV[VX], (F32)pos_global.mdV[VY]));
4329+
}
4330+
4331+
if(regionp && teleportCore(is_local))
43224332
{
43234333
LL_INFOS("Teleport") << "Sending TeleportLandmarkRequest. Current region handle " << regionp->getHandle()
43244334
<< " region id " << regionp->getRegionID()

0 commit comments

Comments
 (0)