diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
index 4d1d913bf8..db3b834735 100644
--- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
+++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
@@ -181,12 +181,19 @@ namespace OpenSim.Region.Framework.Scenes.Animation
m_animations.Clear();
}
-
+
+
+ UUID aoSitGndAnim = UUID.Zero;
+
///
/// The movement animation is reserved for "main" animations
/// that are mutually exclusive, e.g. flying and sitting.
///
/// 'true' if the animation was updated
+ ///
+
+
+
public bool TrySetMovementAnimation(string anim)
{
bool ret = false;
@@ -196,10 +203,28 @@ namespace OpenSim.Region.Framework.Scenes.Animation
// "[SCENE PRESENCE ANIMATOR]: Setting movement animation {0} for {1}",
// anim, m_scenePresence.Name);
+ if (aoSitGndAnim != UUID.Zero)
+ {
+ avnChangeAnim(aoSitGndAnim, false, false);
+ aoSitGndAnim = UUID.Zero;
+ }
+
UUID overridenAnim = m_scenePresence.Overrides.GetOverriddenAnimation(anim);
if (overridenAnim != UUID.Zero)
{
- m_animations.SetDefaultAnimation(overridenAnim, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID);
+ if (anim == "SITGROUND")
+ {
+ UUID defsit = DefaultAvatarAnimations.AnimsUUID["SIT_GROUND_CONSTRAINED"];
+ if (defsit == UUID.Zero)
+ return false;
+ m_animations.SetDefaultAnimation(defsit, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID);
+ aoSitGndAnim = overridenAnim;
+ avnChangeAnim(overridenAnim, true, false);
+ }
+ else
+ {
+ m_animations.SetDefaultAnimation(overridenAnim, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID);
+ }
m_scenePresence.SendScriptEventToAttachments("changed", new Object[] { (int)Changed.ANIMATION });
SendAnimPack();
ret = true;