From 054ebe8878cbd1552fe96c0df631f50d5c2409d3 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 2 Dec 2011 23:56:01 +0000 Subject: Stop some places where we're trying to reset animations in child agents where such requests are ignored. --- .../Scenes/Animation/ScenePresenceAnimator.cs | 13 ++++++++++- OpenSim/Region/Framework/Scenes/Scene.cs | 1 - OpenSim/Region/Framework/Scenes/ScenePresence.cs | 25 ++++++++++------------ 3 files changed, 23 insertions(+), 16 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index 4cf854e..6b1208c 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs @@ -131,8 +131,11 @@ namespace OpenSim.Region.Framework.Scenes.Animation public void ResetAnimations() { +// m_log.DebugFormat( +// "[SCENE PRESENCE ANIMATOR]: Resetting animations for {0} in {1}", +// m_scenePresence.Name, m_scenePresence.Scene.RegionInfo.RegionName); + m_animations.Clear(); - TrySetMovementAnimation("STAND"); } /// @@ -155,6 +158,14 @@ namespace OpenSim.Region.Framework.Scenes.Animation SendAnimPack(); } } + // Don't leave this on since on teleports SP.HandleAgentUpdate() still hammers us for a while after it teleports +// else +// { +// m_log.WarnFormat( +// "[SCENE PRESENCE ANIMATOR]: Tried to set movement animation {0} on child presence {1}", +// anim, m_scenePresence.Name); +// throw new Exception(string.Format("aaargh on setting {0}", anim)); +// } } /// diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 9a71cd4..3ac6327 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3700,7 +3700,6 @@ namespace OpenSim.Region.Framework.Scenes return false; } - ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID); if (childAgentUpdate != null) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 1c2025c..b93b67d 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -995,13 +995,17 @@ namespace OpenSim.Region.Framework.Scenes /// /// This turns a root agent into a child agent + /// + /// /// when an agent departs this region for a neighbor, this gets called. /// /// It doesn't get called for a teleport. Reason being, an agent that /// teleports out may not end up anywhere near this region - /// + /// public void MakeChildAgent() { + m_log.DebugFormat("[SCENE PRESENCE]: Making {0} a child agent in {1}", Name, Scene.RegionInfo.RegionName); + // Reset these so that teleporting in and walking out isn't seen // as teleporting back TeleportFlags = TeleportFlags.Default; @@ -2295,11 +2299,6 @@ namespace OpenSim.Region.Framework.Scenes { m_updateCount = 0; // Kill animation update burst so that the SIT_G.. will stick. Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED"); - - // TODO: This doesn't prevent the user from walking yet. - // Setting parent ID would fix this, if we knew what value - // to use. Or we could add a m_isSitting variable. - //Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED"); SitGround = true; RemoveFromPhysicalScene(); } @@ -2908,9 +2907,12 @@ namespace OpenSim.Region.Framework.Scenes public void Reset() { +// m_log.DebugFormat("[SCENE PRESENCE]: Resetting {0} in {1}", Name, Scene.RegionInfo.RegionName); + // Put the child agent back at the center AbsolutePosition = new Vector3(((float)Constants.RegionSize * 0.5f), ((float)Constants.RegionSize * 0.5f), 70); + Animator.ResetAnimations(); } @@ -3133,7 +3135,7 @@ namespace OpenSim.Region.Framework.Scenes } } - public void CopyFrom(AgentData cAgent) + private void CopyFrom(AgentData cAgent) { m_originRegionID = cAgent.RegionID; @@ -3192,13 +3194,8 @@ namespace OpenSim.Region.Framework.Scenes } } catch { } - // Animations - try - { - Animator.ResetAnimations(); - Animator.Animations.FromArray(cAgent.Anims); - } - catch { } + + Animator.Animations.FromArray(cAgent.Anims); if (cAgent.AttachmentObjects != null && cAgent.AttachmentObjects.Count > 0) { -- cgit v1.1