summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorYuri Chebotarev <ychebotarev@productengine.com>2010-06-02 18:21:25 +0300
committerYuri Chebotarev <ychebotarev@productengine.com>2010-06-02 18:21:25 +0300
commit0473ab08d81a7f5b87dfe02cbb95bd9863df1757 (patch)
treeacbfc36e97fb0de1b5d93a36940b1b9cc61850e1 /indra
parent4ac34230c125e070ba4a78a76d875595e9f7054e (diff)
EXT-7034 FIX add initializationagent position at later state in case initialization at earlier state failed.
reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/480/ --HG-- branch : product-engine
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llnavigationbar.cpp1
-rw-r--r--indra/newview/llteleporthistory.cpp22
-rw-r--r--indra/newview/llteleporthistory.h4
3 files changed, 27 insertions, 0 deletions
diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp
index 251c60b5bf..e5548007bd 100644
--- a/indra/newview/llnavigationbar.cpp
+++ b/indra/newview/llnavigationbar.cpp
@@ -713,6 +713,7 @@ void LLNavigationBar::onNavigationButtonHeldUp(LLButton* nav_button)
void LLNavigationBar::handleLoginComplete()
{
+ LLTeleportHistory::getInstance()->handleLoginComplete();
mCmbLocation->handleLoginComplete();
}
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.
diff --git a/indra/newview/llteleporthistory.h b/indra/newview/llteleporthistory.h
index a82bec7c4f..e035451e71 100644
--- a/indra/newview/llteleporthistory.h
+++ b/indra/newview/llteleporthistory.h
@@ -136,6 +136,10 @@ public:
* @see load()
*/
void dump() const;
+ /**
+ * Process login complete event. Basically put current location into history
+ */
+ void handleLoginComplete();
private: