summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorEugene Mutavchi <emutavchi@productengine.com>2010-04-07 13:38:21 +0300
committerEugene Mutavchi <emutavchi@productengine.com>2010-04-07 13:38:21 +0300
commit244418e6b2f4647d09995492f52180a0d3824cd2 (patch)
treea0dc6aa5adfe6ce010696f06693d786b140c27c9 /indra
parent8a3dca48ebb9d2c48c58187f8e49849c6830737d (diff)
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/
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llagent.cpp10
-rw-r--r--indra/newview/llvoavatar.cpp3
2 files changed, 7 insertions, 6 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index c5d7f6f118..d9d95f1cd6 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -2296,6 +2296,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)
{
@@ -2303,11 +2308,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 f5e83ed025..16eb877b1d 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -5619,6 +5619,8 @@ void LLVOAvatar::sitDown(BOOL bSitting)
//-----------------------------------------------------------------------------
void LLVOAvatar::sitOnObject(LLViewerObject *sit_object)
{
+ sitDown(TRUE);
+
if (isSelf())
{
// Might be first sit
@@ -5651,7 +5653,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();