Better way to make the AO start up correctly, also fixes stuck transient animations since the last changes

master
Zi Ree 2021-11-24 06:10:12 +01:00
parent aba2fb35bc
commit d6b7227b2e
2 changed files with 12 additions and 3 deletions

View File

@ -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)
{

View File

@ -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<AOSet*> mSets;
std::vector<AOSet*> mOldSets;
AOSet* mCurrentSet;