Commits

Stinson Linden  committed 248e88c

EXP-1942: Ensuring that the teleport cancel works in the case of restarting a teleport. Also, ensuring to pull down the teleport screen if we time out of a maturity request with a pending teleport queued.

  • Participants
  • Parent commits 75098a0

Comments (0)

Files changed (1)

File indra/newview/llagent.cpp

 		{
 			llwarns << "Got an error but maturity preference '" << LLViewerRegion::accessToString(mLastKnownRequestMaturity)
 				<< "' seems to be in sync with the server" << llendl;
-			mMaturityPreferenceNumRetries = 0;
+			reportPreferredMaturitySuccess();
 		}
 		// Else, the more likely case is that the last request does not match the last response,
 		// so inform the user
 
 void LLAgent::reportPreferredMaturitySuccess()
 {
+	// If there is a pending teleport request waiting for the maturity preference to be synced with
+	// the server, let's start the pending request
 	if (hasPendingTeleportRequest())
 	{
 		startTeleportRequest();
 
 void LLAgent::reportPreferredMaturityError()
 {
+	// If there is a pending teleport request waiting for the maturity preference to be synced with
+	// the server, we were unable to successfully sync with the server on maturity preference, so let's
+	// just raise the screen.
+	if (hasPendingTeleportRequest())
+	{
+		setTeleportState(LLAgent::TELEPORT_NONE);
+	}
+
 	// Get the last known maturity request from the user activity
 	std::string preferredMaturity = LLViewerRegion::accessToString(mLastKnownRequestMaturity);
 	LLStringUtil::toLower(preferredMaturity);
 // James Cook, July 28, 2005
 void LLAgent::teleportCancel()
 {
+	if (!hasPendingTeleportRequest())
+	{
+		LLViewerRegion* regionp = getRegion();
+		if(regionp)
+		{
+			// send the message
+			LLMessageSystem* msg = gMessageSystem;
+			msg->newMessage("TeleportCancel");
+			msg->nextBlockFast(_PREHASH_Info);
+			msg->addUUIDFast(_PREHASH_AgentID, getID());
+			msg->addUUIDFast(_PREHASH_SessionID, getSessionID());
+			sendReliableMessage();
+		}	
+	}
 	clearTeleportRequest();
-	LLViewerRegion* regionp = getRegion();
-	if(regionp)
-	{
-		// send the message
-		LLMessageSystem* msg = gMessageSystem;
-		msg->newMessage("TeleportCancel");
-		msg->nextBlockFast(_PREHASH_Info);
-		msg->addUUIDFast(_PREHASH_AgentID, getID());
-		msg->addUUIDFast(_PREHASH_SessionID, getSessionID());
-		sendReliableMessage();
-	}	
-	gTeleportDisplay = FALSE;
 	gAgent.setTeleportState( LLAgent::TELEPORT_NONE );
 }