diff --git a/indra/newview/aoengine.cpp b/indra/newview/aoengine.cpp index 0c57f1633f..d9f39434fc 100644 --- a/indra/newview/aoengine.cpp +++ b/indra/newview/aoengine.cpp @@ -442,6 +442,10 @@ void AOEngine::enable(bool enable) gAgent.sendAnimationRequest(animation, ANIM_REQUEST_START); mAnimationChangedSignal(state->mAnimations[state->mCurrentAnimation].mInventoryUUID); + + // remember to ignore this motion once in the overrider so stopping the Linden motion + // will not trigger a stop of the override animation + mIgnoreMotionStopOnce = mLastMotion; } } else @@ -530,14 +534,15 @@ const LLUUID AOEngine::override(const LLUUID& motion, bool start) return LLUUID::null; } - // if we are asked to stop-override the same motion as the currently running one, don't - // return the overridden animation to be stopped, so we can stop the Linden animation + // ignore stopping this motion once so we can stop the Linden animation // without killing our overrider when logging in or re-enabling - if (mLastMotion == motion && !start) + if (!start && motion == mIgnoreMotionStopOnce) { LL_DEBUGS("AOEngine") << "Not stop-overriding motion " << gAnimLibrary.animationName(motion) << " within same state." << LL_ENDL; + mIgnoreMotionStopOnce = LLUUID::null; + // when stopping a sit motion make sure to stop the cycle point cover-up animation if (motion == ANIM_AGENT_SIT) { diff --git a/indra/newview/aoengine.h b/indra/newview/aoengine.h index 8be4dc0001..a9b5c46686 100644 --- a/indra/newview/aoengine.h +++ b/indra/newview/aoengine.h @@ -205,6 +205,10 @@ class AOEngine LLUUID mLastOverriddenMotion; LLUUID mTransitionId; + // this motion will be ignored once in the overrider when stopping, fixes a case + // where the AO doesn't correctly start up on login or when getting enabled manually + LLUUID mIgnoreMotionStopOnce; + std::vector mSets; std::vector mOldSets; AOSet* mCurrentSet;