From da38d4bc482e5e58393d3de22b4cda7efefa2218 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Fri, 27 Sep 2013 13:41:45 -0400 Subject: [PATCH] [VarRegions] Fix copy slurl on map to take the fmod of the x and y against the width of the region in question, instead of 256 --- indra/newview/llfloaterworldmap.cpp | 5 +++++ indra/newview/llslurl.cpp | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 24f11cbfc..1d33194a0 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -875,6 +875,11 @@ void LLFloaterWorldMap::updateLocation() // [/RLVa:KB] // if ( gotSimName ) { + // Singu Note: Var region support for SLURLs + const LLSimInfo* sim = LLWorldMap::getInstance()->simInfoFromPosGlobal(pos_global); + const F64 size(sim ? sim->getSizeX() : 256); + pos_global[0] = fmod(pos_global[0], size); + pos_global[1] = fmod(pos_global[1], size); mSLURL = LLSLURL(sim_name, pos_global); } else diff --git a/indra/newview/llslurl.cpp b/indra/newview/llslurl.cpp index 3f1b194c5..abd21bd75 100644 --- a/indra/newview/llslurl.cpp +++ b/indra/newview/llslurl.cpp @@ -312,9 +312,9 @@ LLSLURL::LLSLURL(const std::string& slurl) mPosition = LLVector3(path_array); // this construction handles LLSD without all components (values default to 0.f) if((F32(mPosition[VX]) < 0.f) || - (mPosition[VX] > REGION_WIDTH_METERS) || + (mPosition[VX] > 8192.f/*REGION_WIDTH_METERS*/) || (F32(mPosition[VY]) < 0.f) || - (mPosition[VY] > REGION_WIDTH_METERS) || + (mPosition[VY] > 8192.f/*REGION_WIDTH_METERS*/) || (F32(mPosition[VZ]) < 0.f) || (mPosition[VZ] > 8192.f/*REGION_HEIGHT_METERS*/)) { @@ -355,8 +355,8 @@ LLSLURL::LLSLURL(const std::string& grid, { mGrid = grid; mRegion = region; - S32 x = llround( (F32)fmod( position[VX], (F32)REGION_WIDTH_METERS ) ); - S32 y = llround( (F32)fmod( position[VY], (F32)REGION_WIDTH_METERS ) ); + S32 x = llround( (F32)position[VX] ); + S32 y = llround( (F32)position[VY] ); S32 z = llround( (F32)position[VZ] ); mType = LOCATION; mPosition = LLVector3(x, y, z);