From 1aad372c78440a02ca9f5abae10bde819547ac2b Mon Sep 17 00:00:00 2001 From: Wolfspirit Date: Sun, 28 Aug 2011 07:31:58 +0200 Subject: [PATCH] FIRE-2823: Get the cords out of the SLURL! --- indra/newview/llslurl.cpp | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/indra/newview/llslurl.cpp b/indra/newview/llslurl.cpp index 1efaa79aab..9c1e6402ff 100644 --- a/indra/newview/llslurl.cpp +++ b/indra/newview/llslurl.cpp @@ -323,11 +323,31 @@ LLSLURL::LLSLURL(const std::string& slurl) LL_DEBUGS("SLURL") << "mRegion: " << mRegion << LL_ENDL; path_array.erase(0); - - // if x, y and z were not fully passed in, go to the middle of the region. - // teleport will adjust the actual location to make sure you're on the ground - // and such - mPosition = LLVector3(REGION_WIDTH_METERS/2, REGION_WIDTH_METERS/2, 0); + + // parse the x, y, z + if(path_array.size() >= 3) + { + + mPosition = LLVector3(path_array); + if((F32(mPosition[VX]) < 0.f) || + (mPosition[VX] > REGION_WIDTH_METERS) || + (F32(mPosition[VY]) < 0.f) || + (mPosition[VY] > REGION_WIDTH_METERS) || + (F32(mPosition[VZ]) < 0.f) || + (mPosition[VZ] > REGION_HEIGHT_METERS)) + { + mType = INVALID; + return; + } + + } + else + { + // if x, y and z were not fully passed in, go to the middle of the region. + // teleport will adjust the actual location to make sure you're on the ground + // and such + mPosition = LLVector3(REGION_WIDTH_METERS/2, REGION_WIDTH_METERS/2, 0); + } } } }