diff options
author | Aimee Linden <aimee@lindenlab.com> | 2010-09-07 21:10:41 +0100 |
---|---|---|
committer | Aimee Linden <aimee@lindenlab.com> | 2010-09-07 21:10:41 +0100 |
commit | 4991d7903dfc460795de345db87c247575fdd1f8 (patch) | |
tree | 8945a33b770171c8acb0bd2a830c50b65d71f509 /indra/newview/llviewermessage.cpp | |
parent | eb10840623b6f0386a7990ee946cfa5879094fb3 (diff) | |
parent | b1c677a6e70db7a0a56b82045ec60288eee20da4 (diff) |
Merge
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
-rw-r--r-- | indra/newview/llviewermessage.cpp | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 781e324e25..2470d5e5a3 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -81,6 +81,7 @@ #include "lluri.h" #include "llviewergenericmessage.h" #include "llviewermenu.h" +#include "llviewerjoystick.h" #include "llviewerobjectlist.h" #include "llviewerparcelmgr.h" #include "llviewerstats.h" @@ -3129,6 +3130,8 @@ void process_teleport_start(LLMessageSystem *msg, void**) U32 teleport_flags = 0x0; msg->getU32("Info", "TeleportFlags", teleport_flags); + LL_DEBUGS("Messaging") << "Got TeleportStart with TeleportFlags=" << teleport_flags << ". gTeleportDisplay: " << gTeleportDisplay << ", gAgent.mTeleportState: " << gAgent.getTeleportState() << LL_ENDL; + if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) { gViewerWindow->setProgressCancelButtonVisible(FALSE); @@ -3147,6 +3150,7 @@ void process_teleport_start(LLMessageSystem *msg, void**) gAgent.setTeleportState( LLAgent::TELEPORT_START ); make_ui_sound("UISndTeleportOut"); + LL_INFOS("Messaging") << "Teleport initiated by remote TeleportStart message with TeleportFlags: " << teleport_flags << LL_ENDL; // Don't call LLFirstUse::useTeleport here because this could be // due to being killed, which would send you home, not to a Telehub } @@ -3488,6 +3492,12 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) if( is_teleport ) { + if (gAgent.getTeleportKeepsLookAt()) + { + // *NOTE: the LookAt data we get from the sim here doesn't + // seem to be useful, so get it from the camera instead + look_at = LLViewerCamera::getInstance()->getAtAxis(); + } // Force the camera back onto the agent, don't animate. gAgentCamera.setFocusOnAvatar(TRUE, FALSE); gAgentCamera.slamLookAt(look_at); @@ -3534,7 +3544,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) { LLTracker::stopTracking(NULL); } - else if ( is_teleport ) + else if ( is_teleport && !gAgent.getTeleportKeepsLookAt() ) { //look at the beacon LLVector3 global_agent_pos = agent_pos; @@ -5806,7 +5816,18 @@ void process_teleport_local(LLMessageSystem *msg,void**) if( gAgent.getTeleportState() != LLAgent::TELEPORT_NONE ) { - gAgent.setTeleportState( LLAgent::TELEPORT_NONE ); + if( gAgent.getTeleportState() == LLAgent::TELEPORT_LOCAL ) + { + // To prevent TeleportStart messages re-activating the progress screen right + // after tp, keep the teleport state and let progress screen clear it after a short delay + // (progress screen is active but not visible) *TODO: remove when SVC-5290 is fixed + gTeleportDisplayTimer.reset(); + gTeleportDisplay = TRUE; + } + else + { + gAgent.setTeleportState( LLAgent::TELEPORT_NONE ); + } } // Sim tells us whether the new position is off the ground @@ -5822,8 +5843,10 @@ void process_teleport_local(LLMessageSystem *msg,void**) gAgent.setPositionAgent(pos); gAgentCamera.slamLookAt(look_at); - // likewise make sure the camera is behind the avatar - gAgentCamera.resetView(TRUE, TRUE); + if ( !(gAgent.getTeleportKeepsLookAt() && LLViewerJoystick::getInstance()->getOverrideCamera()) ) + { + gAgentCamera.resetView(TRUE, TRUE); + } // send camera update to new region gAgentCamera.updateCamera(); |