From 18023169e79584cd3ddb4f544f9d485edc9e1b85 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 9 Sep 2014 04:12:10 +0200 Subject: [PATCH] Actually do the overriding --- .../Framework/Scenes/Animation/ScenePresenceAnimator.cs | 8 +++++++- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index fdadd32726..3cb8f598e8 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs @@ -196,7 +196,13 @@ namespace OpenSim.Region.Framework.Scenes.Animation // "[SCENE PRESENCE ANIMATOR]: Setting movement animation {0} for {1}", // anim, m_scenePresence.Name); - if (m_animations.TrySetDefaultAnimation( + UUID overridenAnim = m_scenePresence.Overrides.GetOverriddenAnimation(anim); + if (overridenAnim != UUID.Zero) + { + m_animations.SetDefaultAnimation(overridenAnim, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID); + ret = true; + } + else if (m_animations.TrySetDefaultAnimation( anim, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID)) { // m_log.DebugFormat( diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 4d5f747c99..8f6b41b5ca 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -239,6 +239,11 @@ namespace OpenSim.Region.Framework.Scenes /// public ScenePresenceAnimator Animator { get; private set; } + /// + /// Server Side Animation Override + /// + public MovementAnimationOverrides Overrides { get; private set; } + /// /// Attachments recorded on this avatar. /// @@ -967,6 +972,7 @@ namespace OpenSim.Region.Framework.Scenes IsLoggingIn = false; m_sendCoarseLocationsMethod = SendCoarseLocationsDefault; Animator = new ScenePresenceAnimator(this); + Overrides = new MovementAnimationOverrides(); PresenceType = type; DrawDistance = world.DefaultDrawDistance; RegionHandle = world.RegionInfo.RegionHandle; @@ -6007,6 +6013,7 @@ namespace OpenSim.Region.Framework.Scenes public void SetAnimationOverride(string animState, UUID animID) { + Overrides.SetOverride(animState, animID); } } }