summaryrefslogtreecommitdiff
path: root/indra/newview/llteleporthistory.cpp
diff options
context:
space:
mode:
authorAndrew A. de Laix <alain@lindenlab.com>2010-06-09 15:47:37 -0700
committerAndrew A. de Laix <alain@lindenlab.com>2010-06-09 15:47:37 -0700
commitf2f7f7b3bb2c8466e2a07f8f586a1a63fdae8a66 (patch)
tree9c74f8e5ca2601bbdf87a4b5e034b76784bdacea /indra/newview/llteleporthistory.cpp
parent163b767944caa4b2a474abf93e64eaeac1f02587 (diff)
parent4bbca7c086724da1af4f8cb6b22e6de8320a0b1b (diff)
merge
Diffstat (limited to 'indra/newview/llteleporthistory.cpp')
-rw-r--r--indra/newview/llteleporthistory.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/indra/newview/llteleporthistory.cpp b/indra/newview/llteleporthistory.cpp
index 15684337f4..cac3b58464 100644
--- a/indra/newview/llteleporthistory.cpp
+++ b/indra/newview/llteleporthistory.cpp
@@ -38,6 +38,7 @@
#include "llsdserialize.h"
#include "llagent.h"
+#include "llvoavatarself.h"
#include "llslurl.h"
#include "llviewercontrol.h" // for gSavedSettings
#include "llviewerparcelmgr.h"
@@ -108,6 +109,16 @@ void LLTeleportHistory::onTeleportFailed()
}
}
+void LLTeleportHistory::handleLoginComplete()
+{
+ if( mGotInitialUpdate )
+ {
+ return;
+ }
+ updateCurrentLocation(gAgent.getPositionGlobal());
+}
+
+
void LLTeleportHistory::updateCurrentLocation(const LLVector3d& new_pos)
{
if (mRequestedItem != -1) // teleport within the history in progress?
@@ -117,6 +128,17 @@ void LLTeleportHistory::updateCurrentLocation(const LLVector3d& new_pos)
}
else
{
+ //EXT-7034
+ //skip initial update if agent avatar is no valid yet
+ //this may happen when updateCurrentLocation called while login process
+ //sometimes isAgentAvatarValid return false and in this case new_pos
+ //(which actually is gAgent.getPositionGlobal() ) is invalid
+ //if this position will be saved then teleport back will teleport user to wrong position
+ if ( !mGotInitialUpdate && !isAgentAvatarValid() )
+ {
+ return ;
+ }
+
// If we're getting the initial location update
// while we already have a (loaded) non-empty history,
// there's no need to purge forward items or add a new item.