diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index a0201ab03..a128ee600 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -137,6 +137,7 @@ #include "llviewerjoystick.h" #include "llfollowcam.h" // +#include "llao.h" #include "llworldmapmessage.h" // using namespace LLVOAvatarDefines; @@ -4957,6 +4958,10 @@ void LLAgent::onAnimStop(const LLUUID& id) // handle automatic state transitions (based on completion of animation playback) if (id == ANIM_AGENT_STAND) { + // + if(LLAO::isEnabled()) + LLAO::mTimer->resume();//Timer only pauses if its not paused, check is inside function. + // stopFidget(); } else if (id == ANIM_AGENT_AWAY) diff --git a/indra/newview/llao.cpp b/indra/newview/llao.cpp index 8616d9303..6f5b630ce 100644 --- a/indra/newview/llao.cpp +++ b/indra/newview/llao.cpp @@ -8,8 +8,6 @@ #include "llsdserialize.h" #include "llagent.h" #include "llvoavatar.h" -//this is for debugging ;D -//#define AO_DEBUG //static variables std::list LLAO::mStandOverrides; @@ -18,7 +16,6 @@ LLFloaterAO* LLFloaterAO::sInstance; BOOL LLAO::mEnabled = FALSE; F32 LLAO::mPeriod; LLAOStandTimer* LLAO::mTimer = NULL; -S32 LLAO::playingStands = 0; LLAOStandTimer::LLAOStandTimer(F32 period) : LLEventTimer(period) { diff --git a/indra/newview/llao.h b/indra/newview/llao.h index 2100402ea..96d33adbf 100644 --- a/indra/newview/llao.h +++ b/indra/newview/llao.h @@ -2,6 +2,9 @@ #ifndef LL_LLAO_H #define LL_LLAO_H +//this is for debugging ;D +//#define AO_DEBUG + #include "llfloater.h" #include "llcombobox.h" @@ -21,7 +24,6 @@ class LLAO { public: static void setup(); - static S32 playingStands; static std::map mOverrides; static std::list mStandOverrides; static BOOL isEnabled(){ return mEnabled; } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 5bccdad4f..be3812f35 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2582,6 +2582,10 @@ BOOL LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) // trigger fidget anims if (isAnyAnimationSignaled(AGENT_STAND_ANIMS, NUM_AGENT_STAND_ANIMS)) { + // + if(LLAO::isEnabled()) + LLAO::mTimer->resume();//Timer only pauses if its not paused, check is inside function. + // agent.fidget(); } } @@ -5161,12 +5165,6 @@ BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset) { if(LLAO::isEnabled()) { - if(LLAO::isStand(id)) - { - if(LLAO::playingStands == 0) - LLAO::mTimer->resume();//Timer only resumes if its paused, check is inside function. - LLAO::playingStands++; - } if(LLAO::mOverrides.find(id) != LLAO::mOverrides.end()) { // avoid infinite loops! @@ -5202,7 +5200,10 @@ BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset) return LLCharacter::startMotion(id, time_offset); } - +bool findStandAnim(const LLUUID& id,std::pair p) +{ + return id != p.first && LLAO::isStand(p.first); +} //----------------------------------------------------------------------------- // stopMotion() //----------------------------------------------------------------------------- @@ -5213,13 +5214,6 @@ BOOL LLVOAvatar::stopMotion(const LLUUID& id, BOOL stop_immediate) // if(LLAO::isEnabled()) { - if(LLAO::isStand(id) && LLAO::playingStands > 0) //LLAO::playingStands > 0 stops it from going negative - { - //help the timer get started again - LLAO::playingStands--; - if(LLAO::playingStands == 0) - LLAO::mTimer->pause();//Timer only pauses if its not paused, check is inside function. - } if( (LLAO::mOverrides.find(id) != LLAO::mOverrides.end()) && (id != LLAO::mOverrides[id]) ) {