Commits

Anonymous committed 781a730

Fixed critical bug EXT-1655 ([BSI] Always flying after pressing "Stand" to stand up from an object)
- moved restoring the flying of the agent before calling the mAutoPilotFinishedCallback, to allow finished callback to change it.
- fixed LLVOAvatar::sitOnObject() to set mIsSitting = TRUE before stoping the autopilot, like it was in 1.23 version.
Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/185/

Comments (0)

Files changed (2)

indra/newview/llagent.cpp

 		{
 			resetAxes(mAutoPilotTargetFacing);
 		}
+		// If the user cancelled, don't change the fly state
+		if (!user_cancel)
+		{
+			setFlying(mAutoPilotFlyOnStop);
+		}
 		//NB: auto pilot can terminate for a reason other than reaching the destination
 		if (mAutoPilotFinishedCallback)
 		{
 		}
 		mLeaderID = LLUUID::null;
 
-		// If the user cancelled, don't change the fly state
-		if (!user_cancel)
-		{
-			setFlying(mAutoPilotFlyOnStop);
-		}
 		setControlFlags(AGENT_CONTROL_STOP);
 
 		if (user_cancel && !mAutoPilotBehaviorName.empty())

indra/newview/llvoavatar.cpp

 //-----------------------------------------------------------------------------
 void LLVOAvatar::sitOnObject(LLViewerObject *sit_object)
 {
+	sitDown(TRUE);
+
 	if (isSelf())
 	{
 		// Might be first sit
 	mDrawable->mXform.setRotation(mDrawable->getWorldRotation() * inv_obj_rot);
 
 	gPipeline.markMoved(mDrawable, TRUE);
-	sitDown(TRUE);
 	mRoot.getXform()->setParent(&sit_object->mDrawable->mXform); // LLVOAvatar::sitOnObject
 	mRoot.setPosition(getPosition());
 	mRoot.updateWorldMatrixChildren();