From e37fd5e716a44a57290d87239d52b2b62c0dae4a Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 9 Sep 2014 22:27:21 +0100 Subject: force update of movement animation --- .../Framework/Scenes/Animation/ScenePresenceAnimator.cs | 15 ++++++++++++++- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index 9fd5e64..bbc5745 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs @@ -475,7 +475,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation string newMovementAnimation = DetermineMovementAnimation(); if (CurrentMovementAnimation != newMovementAnimation) { - CurrentMovementAnimation = DetermineMovementAnimation(); + CurrentMovementAnimation = newMovementAnimation; // m_log.DebugFormat( // "[SCENE PRESENCE ANIMATOR]: Determined animation {0} for {1} in UpdateMovementAnimations()", @@ -489,6 +489,19 @@ namespace OpenSim.Region.Framework.Scenes.Animation return ret; } + public bool ForceUpdateMovementAnimations() + { + // m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Updating movement animations for {0}", m_scenePresence.Name); + + bool ret = false; + lock (m_animations) + { + string newMovementAnimation = DetermineMovementAnimation(); + ret = TrySetMovementAnimation(newMovementAnimation); + } + return ret; + } + public UUID[] GetAnimationArray() { UUID[] animIDs; diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index c24a4a2..5da92f9 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -6040,7 +6040,7 @@ namespace OpenSim.Region.Framework.Scenes { Overrides.SetOverride(animState, animID); // Animator.SendAnimPack(); - Animator.UpdateMovementAnimations(); + Animator.ForceUpdateMovementAnimations(); } public UUID GetAnimationOverride(string animState) -- cgit v1.1