[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
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user