From 0f2ff58ff603e9a705adafebc4cf52d414ab0be3 Mon Sep 17 00:00:00 2001 From: ZiRee Date: Wed, 20 Apr 2011 18:02:04 +0200 Subject: [PATCH] Trying to get ground sit to work. Unstable. --- indra/newview/aoengine.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/indra/newview/aoengine.cpp b/indra/newview/aoengine.cpp index 57f24c9831..3ba838af60 100644 --- a/indra/newview/aoengine.cpp +++ b/indra/newview/aoengine.cpp @@ -217,10 +217,12 @@ void AOEngine::enable(BOOL yes) } } -const LLUUID AOEngine::override(const LLUUID motion,BOOL start) +const LLUUID AOEngine::override(const LLUUID pMotion,BOOL start) { LLUUID animation; + LLUUID motion=pMotion; + if(!mEnabled) { if(start && mCurrentSet) @@ -252,6 +254,13 @@ const LLUUID AOEngine::override(const LLUUID motion,BOOL start) return animation; } + // we don't distinguish between these two + if(motion==ANIM_AGENT_SIT_GROUND_CONSTRAINED) + { + llwarns << "Mapping ground sit constrained to ground sit" << llendl; + motion=ANIM_AGENT_SIT_GROUND; + } + AOSet::AOState* state=mCurrentSet->getStateByRemapID(motion); if(!state) { @@ -291,7 +300,7 @@ const LLUUID AOEngine::override(const LLUUID motion,BOOL start) } // do not remember typing as set-wide motion - if(motion!=ANIM_AGENT_TYPE) + if(motion!=ANIM_AGENT_TYPE && motion!=ANIM_AGENT_SIT_GROUND) mCurrentSet->setMotion(motion); animation=mCurrentSet->getAnimationForState(state); @@ -309,6 +318,9 @@ const LLUUID AOEngine::override(const LLUUID motion,BOOL start) if(motion==ANIM_AGENT_SIT) mSitCancelTimer.oneShot(); + else if(motion==ANIM_AGENT_SIT_GROUND) + gAgentAvatarp->mPlayingAnimations[pMotion]=TRUE; +// gAgent.sendAnimationRequest(pMotion,ANIM_REQUEST_START); } else { @@ -319,6 +331,12 @@ const LLUUID AOEngine::override(const LLUUID motion,BOOL start) if(motion==ANIM_AGENT_TYPE) return animation; + if(motion==ANIM_AGENT_SIT_GROUND) + { + gAgent.sendAnimationRequest(pMotion,ANIM_REQUEST_STOP); + return animation; + } + if(motion!=mCurrentSet->getMotion()) { llwarns << "trying to stop-override motion " << gAnimLibrary.animStateToString(motion)