Fix sit animations getting reset on region crossing when the AO wasn't doing any overriding. FIRE-13872

ziree 2014-07-25 00:37:26 +02:00
parent 8dab820f30
commit 2c99d59910
1 changed files with 39 additions and 0 deletions

View File

@ -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);
}