diff --git a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs index da1b9e00b7..33041e9ac7 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs @@ -168,11 +168,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation public OpenSim.Framework.Animation[] ToArray() { - OpenSim.Framework.Animation[] theArray = new OpenSim.Framework.Animation[m_animations.Count + 1]; + OpenSim.Framework.Animation[] theArray = new OpenSim.Framework.Animation[m_animations.Count]; uint i = 0; try { - theArray[i++] = m_defaultAnimation; foreach (OpenSim.Framework.Animation anim in m_animations) theArray[i++] = anim; } @@ -185,14 +184,8 @@ namespace OpenSim.Region.Framework.Scenes.Animation public void FromArray(OpenSim.Framework.Animation[] theArray) { -// foreach (OpenSim.Framework.Animation anim in theArray) -// m_animations.Add(anim); - if (theArray.Length > 0) - { - m_defaultAnimation = theArray[0]; - for (int i = 1; i < theArray.Length; i++) - m_animations.Add(theArray[i]); - } + foreach (OpenSim.Framework.Animation anim in theArray) + m_animations.Add(anim); } } } diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 991074b98e..7136cfcaef 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -866,7 +866,7 @@ namespace OpenSim.Region.Framework.Scenes IsChildAgent = false; -// Animator.TryFixMovementAnimation("SIT"); + Animator.TrySetMovementAnimation("SIT"); } else { @@ -929,15 +929,7 @@ namespace OpenSim.Region.Framework.Scenes } AbsolutePosition = pos; - if (m_teleportFlags == TeleportFlags.Default) - { - Vector3 vel = Velocity; - AddToPhysicalScene(isFlying); - if (PhysicsActor != null) - PhysicsActor.SetMomentum(vel); - } - else - AddToPhysicalScene(isFlying); + AddToPhysicalScene(isFlying); if (ForceFly) { @@ -951,8 +943,7 @@ namespace OpenSim.Region.Framework.Scenes // Don't send an animation pack here, since on a region crossing this will sometimes cause a flying // avatar to return to the standing position in mid-air. On login it looks like this is being sent // elsewhere anyway -// Animator.SendAnimPack(); - + // Animator.SendAnimPack(); m_scene.SwapRootAgentCount(false); @@ -989,7 +980,6 @@ namespace OpenSim.Region.Framework.Scenes // If we don't reset the movement flag here, an avatar that crosses to a neighbouring sim and returns will // stall on the border crossing since the existing child agent will still have the last movement // recorded, which stops the input from being processed. - MovementFlag = 0; m_scene.EventManager.TriggerOnMakeRootAgent(this); @@ -1030,8 +1020,6 @@ namespace OpenSim.Region.Framework.Scenes // as teleporting back TeleportFlags = TeleportFlags.Default; - MovementFlag = 0; - // It looks like Animator is set to null somewhere, and MakeChild // is called after that. Probably in aborted teleports. if (Animator == null) @@ -1039,7 +1027,6 @@ namespace OpenSim.Region.Framework.Scenes else Animator.ResetAnimations(); - // m_log.DebugFormat( // "[SCENE PRESENCE]: Downgrading root agent {0}, {1} to a child agent in {2}", // Name, UUID, m_scene.RegionInfo.RegionName); @@ -1066,9 +1053,9 @@ namespace OpenSim.Region.Framework.Scenes { // PhysicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients; PhysicsActor.OnOutOfBounds -= OutOfBoundsCall; - PhysicsActor.OnCollisionUpdate -= PhysicsCollisionUpdate; - PhysicsActor.UnSubscribeEvents(); m_scene.PhysicsScene.RemoveAvatar(PhysicsActor); + PhysicsActor.UnSubscribeEvents(); + PhysicsActor.OnCollisionUpdate -= PhysicsCollisionUpdate; PhysicsActor = null; } // else