From 2c99d59910bbff2b8341dcedf3f44c520473edf1 Mon Sep 17 00:00:00 2001 From: ziree Date: Fri, 25 Jul 2014 00:37:26 +0200 Subject: [PATCH] Fix sit animations getting reset on region crossing when the AO wasn't doing any overriding. FIRE-13872 --- indra/newview/aoengine.cpp | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/indra/newview/aoengine.cpp b/indra/newview/aoengine.cpp index 52f42aca30..652fbe141e 100644 --- a/indra/newview/aoengine.cpp +++ b/indra/newview/aoengine.cpp @@ -1793,6 +1793,45 @@ const LLUUID& AOEngine::getAOFolder() const void AOEngine::onRegionChange() { + // do nothing if the AO is off + if(!mEnabled) + { + return; + } + + // catch errors without crashing + if(!mCurrentSet) + { + LL_DEBUGS("AOEngine") << "Current set was NULL" << LL_ENDL; + return; + } + + // sitting needs special attention + if(mCurrentSet->getMotion()==ANIM_AGENT_SIT) + { + // do nothing if sit overrides was disabled + if(!mCurrentSet->getSitOverride()) + { + return; + } + + // do nothing if the last overridden motion wasn't a sit. + // happens when sit override is enabled but there were no + // sit animations added to the set yet + if(mLastOverriddenMotion!=ANIM_AGENT_SIT) + { + return; + } + + // do nothing if smart sit is enabled because we have no + // animation running from the AO + if(mCurrentSet->getSmart()) + { + return; + } + } + + // restart current animation on region crossing gAgent.sendAnimationRequest(mLastMotion,ANIM_REQUEST_START); }