From 7dd71a60c51ed81c1ddfa98d09a158488a85b753 Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Wed, 7 Apr 2010 13:38:21 +0300 Subject: 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/ --HG-- branch : product-engine --- indra/newview/llagent.cpp | 10 +++++----- indra/newview/llvoavatar.cpp | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 37d1bd15e1..056f406942 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -1295,6 +1295,11 @@ void LLAgent::stopAutoPilot(BOOL user_cancel) { 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) { @@ -1302,11 +1307,6 @@ void LLAgent::stopAutoPilot(BOOL user_cancel) } 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()) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 540cb47710..14750c996c 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5607,6 +5607,8 @@ void LLVOAvatar::sitDown(BOOL bSitting) //----------------------------------------------------------------------------- void LLVOAvatar::sitOnObject(LLViewerObject *sit_object) { + sitDown(TRUE); + if (isSelf()) { // Might be first sit @@ -5639,7 +5641,6 @@ void LLVOAvatar::sitOnObject(LLViewerObject *sit_object) 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(); -- cgit v1.2.3