summaryrefslogtreecommitdiff
path: root/indra/newview/llagent.cpp
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2007-12-04 16:46:00 +0000
committerSteven Bennetts <steve@lindenlab.com>2007-12-04 16:46:00 +0000
commitf8511d77a70bea452cde7270b47044358e58427c (patch)
tree7772dd518136c7f466693f26db437ed1cf23caa6 /indra/newview/llagent.cpp
parent90aa2ddb2efede12f12011fc163e3007e3ba7104 (diff)
EFFECTIVE MERGE: maint-ui-qa3 -r 73391:74133 -> release
ACTUAL MERGE: merge release@74893 maint-ui-3-merge@74902 -> release
Diffstat (limited to 'indra/newview/llagent.cpp')
-rw-r--r--indra/newview/llagent.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 39d4a3fc15..5aaf9d0097 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -102,6 +102,7 @@
#include "lltoolpie.h"
#include "lltoolview.h"
#include "llui.h" // for make_ui_sound
+#include "llurldispatcher.h"
#include "llviewercamera.h"
#include "llviewerinventory.h"
#include "llviewermenu.h"
@@ -904,6 +905,24 @@ const LLHost& LLAgent::getRegionHost() const
}
}
+//-----------------------------------------------------------------------------
+// getSLURL()
+// returns empty() if getRegion() == NULL
+//-----------------------------------------------------------------------------
+std::string LLAgent::getSLURL() const
+{
+ std::string slurl;
+ LLViewerRegion *regionp = getRegion();
+ if (regionp)
+ {
+ LLVector3d agentPos = getPositionGlobal();
+ S32 x = llround( (F32)fmod( agentPos.mdV[VX], (F64)REGION_WIDTH_METERS ) );
+ S32 y = llround( (F32)fmod( agentPos.mdV[VY], (F64)REGION_WIDTH_METERS ) );
+ S32 z = llround( (F32)agentPos.mdV[VZ] );
+ slurl = LLURLDispatcher::buildSLURL(regionp->getName(), x, y, z);
+ }
+ return slurl;
+}
//-----------------------------------------------------------------------------
// inPrelude()
@@ -1021,7 +1040,7 @@ void LLAgent::slamLookAt(const LLVector3 &look_at)
//-----------------------------------------------------------------------------
// getPositionGlobal()
//-----------------------------------------------------------------------------
-const LLVector3d &LLAgent::getPositionGlobal()
+const LLVector3d &LLAgent::getPositionGlobal() const
{
if (!mAvatarObject.isNull() && !mAvatarObject->mDrawable.isNull())
{
@@ -5783,6 +5802,11 @@ void LLAgent::setTeleportState(ETeleportState state)
{
LLFloaterSnapshot::hide(0);
}
+ if (mTeleportState == TELEPORT_MOVING)
+ {
+ // We're outa here. Save "back" slurl.
+ mTeleportSourceSLURL = getSLURL();
+ }
}
void LLAgent::fidget()