FIRE-1213: make AO startup on login and on/off toggle more robust

master
Zi Ree 2021-11-20 19:21:49 +01:00
parent 9837fc5341
commit d341c8fa92
1 changed files with 25 additions and 8 deletions

View File

@ -532,6 +532,23 @@ const LLUUID AOEngine::override(const LLUUID& pMotion, bool start)
return animation;
}
// 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
// without killing our overrider when logging in or re-enabling
if (mLastMotion == pMotion && !start)
{
LL_DEBUGS("AOEngine") << "Not overriding motion " << gAnimLibrary.animationName(motion)
<< " within same state." << LL_ENDL;
// when stopping a sit motion make sure to stop the cycle point cover-up animation
if (motion == ANIM_AGENT_SIT)
{
gAgent.sendAnimationRequest(ANIM_AGENT_SIT_GENERIC, ANIM_REQUEST_STOP);
}
return animation;
}
// we don't distinguish between these two
if (motion == ANIM_AGENT_SIT_GROUND)
{
@ -562,7 +579,7 @@ const LLUUID AOEngine::override(const LLUUID& pMotion, bool start)
// gAgentAvatarp->LLCharacter::stopMotion(motion);
// }
// }
return animation;
return LLUUID::null;
}
mAnimationChangedSignal(LLUUID::null);
@ -756,6 +773,13 @@ const LLUUID AOEngine::override(const LLUUID& pMotion, bool start)
return animation;
}
// stop the underlying Linden Lab motion, in case it's still running.
// frequently happens with sits, so we keep it only for those currently.
if (motion == ANIM_AGENT_SIT)
{
stopAllSitVariants();
}
if (motion != mCurrentSet->getMotion())
{
LL_WARNS("AOEngine") << "trying to stop-override motion " << gAnimLibrary.animationName(motion)
@ -777,13 +801,6 @@ const LLUUID AOEngine::override(const LLUUID& pMotion, bool start)
setStateCycleTimer(state);
return LLUUID::null;
}
// stop the underlying Linden Lab motion, in case it's still running.
// frequently happens with sits, so we keep it only for those currently.
if (mLastMotion == ANIM_AGENT_SIT)
{
stopAllSitVariants();
}
}
return animation;