Allow default animation to be stopped to be replaced with another one.

Fixes Mantis #6327
This commit is contained in:
Melanie
2012-10-04 15:20:04 +02:00
parent aa52c8b20f
commit b977f962fa
2 changed files with 29 additions and 16 deletions

View File

@@ -408,13 +408,19 @@ namespace OpenSim.Region.Framework.Scenes.Animation
{
lock (m_animations)
{
CurrentMovementAnimation = DetermineMovementAnimation();
string newMovementAnimation = DetermineMovementAnimation();
if (CurrentMovementAnimation != newMovementAnimation)
{
CurrentMovementAnimation = DetermineMovementAnimation();
// m_log.DebugFormat(
// "[SCENE PRESENCE ANIMATOR]: Determined animation {0} for {1} in UpdateMovementAnimations()",
// CurrentMovementAnimation, m_scenePresence.Name);
// m_log.DebugFormat(
// "[SCENE PRESENCE ANIMATOR]: Determined animation {0} for {1} in UpdateMovementAnimations()",
// CurrentMovementAnimation, m_scenePresence.Name);
TrySetMovementAnimation(CurrentMovementAnimation);
// Only set it if it's actually changed, give a script
// a chance to stop a default animation
TrySetMovementAnimation(CurrentMovementAnimation);
}
}
}
@@ -536,4 +542,4 @@ namespace OpenSim.Region.Framework.Scenes.Animation
SendAnimPack(animIDs, sequenceNums, objectIDs);
}
}
}
}