diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index 538e1b5c06..5078f69729 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs @@ -320,6 +320,7 @@ namespace OpenSim.Framework public Animation[] Anims; public Animation DefaultAnim = null; public Animation AnimState = null; + public Byte MotionState = 0; public UUID GranterID; public UUID ParentPart; @@ -434,6 +435,11 @@ namespace OpenSim.Framework args["movementAO"] = AOs; } + if (MotionState != 0) + { + args["motion_state"] = OSD.FromInteger(MotionState); + } + if (Appearance != null) args["packed_appearance"] = Appearance.Pack(); @@ -676,6 +682,9 @@ namespace OpenSim.Framework } } + if (args.ContainsKey("motion_state")) + MotionState = (byte)args["motion_state"].AsInteger(); + //if ((args["agent_textures"] != null) && (args["agent_textures"]).Type == OSDType.Array) //{ // OSDArray textures = (OSDArray)(args["agent_textures"]); diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index dbeba9acaf..3509ae732f 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1313,7 +1313,9 @@ namespace OpenSim.Region.Framework.Scenes m_currentParcelHide = false; m_currentParcelUUID = UUID.Zero; // FIXME: Set RegionHandle to the region handle of the scene this agent is moving into - + + CollisionPlane = Vector4.UnitW; + m_scene.EventManager.TriggerOnMakeChildAgent(this); } @@ -1659,7 +1661,7 @@ namespace OpenSim.Region.Framework.Scenes client.Name, Scene.Name, AbsolutePosition); m_inTransit = true; - bool newhide = false; + try { // Make sure it's not a login agent. We don't want to wait for updates during login @@ -1805,6 +1807,7 @@ namespace OpenSim.Region.Framework.Scenes SendAppearanceToAgent(this); // send this animations + UUID[] animIDs = null; int[] animseqs = null; UUID[] animsobjs = null; @@ -4222,6 +4225,8 @@ namespace OpenSim.Region.Framework.Scenes cAgent.MovementAnimationOverRides = Overrides.CloneAOPairs(); + cAgent.MotionState = (byte)Animator.currentControlState; + if (Scene.AttachmentsModule != null) Scene.AttachmentsModule.CopyAttachments(this, cAgent); } @@ -4305,6 +4310,8 @@ namespace OpenSim.Region.Framework.Scenes Animator.Animations.SetImplicitDefaultAnimation(cAgent.AnimState.AnimID, cAgent.AnimState.SequenceNum, UUID.Zero); if (cAgent.Anims != null) Animator.Animations.FromArray(cAgent.Anims); + if (cAgent.MotionState != 0) + Animator.currentControlState = (ScenePresenceAnimator.motionControlStates) cAgent.MotionState; if (Scene.AttachmentsModule != null) Scene.AttachmentsModule.CopyAttachments(cAgent, this);