From 55ee6284909102d64b86e6ccbb5b421cd3af176f Mon Sep 17 00:00:00 2001 From: ziree Date: Thu, 12 Jan 2012 15:58:11 +0100 Subject: [PATCH] Smart AO got confused with animations running from attachments or objects other than the seat. Fixes FIRE-3896 --- indra/newview/aoengine.cpp | 17 +++++++++++++---- indra/newview/aoengine.h | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/indra/newview/aoengine.cpp b/indra/newview/aoengine.cpp index 4f365d53d3..883b9e6105 100644 --- a/indra/newview/aoengine.cpp +++ b/indra/newview/aoengine.cpp @@ -137,13 +137,16 @@ void AOEngine::setLastOverriddenMotion(const LLUUID& motion) mLastOverriddenMotion=motion; } -BOOL AOEngine::foreignAnimations() +BOOL AOEngine::foreignAnimations(const LLUUID& seat) { for(LLVOAvatar::AnimSourceIterator sourceIterator=gAgentAvatarp->mAnimationSources.begin(); sourceIterator!=gAgentAvatarp->mAnimationSources.end();sourceIterator++) { if(sourceIterator->first!=gAgent.getID()) - return TRUE; + { + if(seat.isNull() || sourceIterator->first==seat) + return TRUE; + } } return FALSE; } @@ -260,7 +263,7 @@ void AOEngine::enable(BOOL yes) lldebugs << "state "<< index <<" returned NULL." << llendl; } - if(!foreignAnimations()) + if(!foreignAnimations(LLUUID::null)) gAgent.sendAnimationRequest(mLastMotion,ANIM_REQUEST_START); mCurrentSet->stopTimer(); @@ -466,7 +469,13 @@ const LLUUID AOEngine::override(const LLUUID& pMotion,BOOL start) void AOEngine::checkSitCancel() { - if(foreignAnimations()) + LLUUID seat; + + const LLViewerObject* agentRoot=dynamic_cast(gAgentAvatarp->getRoot()); + if(agentRoot) + seat=agentRoot->getID(); + + if(foreignAnimations(seat)) { LLUUID animation=mCurrentSet->getStateByRemapID(ANIM_AGENT_SIT)->mCurrentAnimationID; if(animation.notNull()) diff --git a/indra/newview/aoengine.h b/indra/newview/aoengine.h index a98d9535d1..6f5d3d5267 100644 --- a/indra/newview/aoengine.h +++ b/indra/newview/aoengine.h @@ -160,7 +160,7 @@ class AOEngine void stopAllStandVariants(); void stopAllSitVariants(); - BOOL foreignAnimations(); + BOOL foreignAnimations(const LLUUID& seat); const LLUUID& mapSwimming(const LLUUID& motion) const; void updateSortOrder(AOSet::AOState* state);