From df8eae1957141bff721a40eeb07b14584fea473f Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 10 Sep 2014 20:55:00 +0100 Subject: [PATCH] handle AO sit ground case --- .../Scenes/Animation/ScenePresenceAnimator.cs | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) 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;