aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs28
1 files changed, 21 insertions, 7 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index a3839c2..26fa6c0 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -874,6 +874,8 @@ namespace OpenSim.Region.Framework.Scenes
874 "[SCENE]: Upgrading child to root agent for {0} in {1}", 874 "[SCENE]: Upgrading child to root agent for {0} in {1}",
875 Name, m_scene.RegionInfo.RegionName); 875 Name, m_scene.RegionInfo.RegionName);
876 876
877 bool wasChild = IsChildAgent;
878
877 if (ParentUUID != UUID.Zero) 879 if (ParentUUID != UUID.Zero)
878 { 880 {
879 m_log.DebugFormat("[SCENE PRESENCE]: Sitting avatar back on prim {0}", ParentUUID); 881 m_log.DebugFormat("[SCENE PRESENCE]: Sitting avatar back on prim {0}", ParentUUID);
@@ -893,10 +895,16 @@ namespace OpenSim.Region.Framework.Scenes
893 pos = ParentPosition; 895 pos = ParentPosition;
894 } 896 }
895 ParentUUID = UUID.Zero; 897 ParentUUID = UUID.Zero;
898
899 IsChildAgent = false;
900
901 Animator.TrySetMovementAnimation("SIT");
902 }
903 else
904 {
905 IsChildAgent = false;
896 } 906 }
897 907
898 bool wasChild = IsChildAgent;
899 IsChildAgent = false;
900 908
901 IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>(); 909 IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
902 if (gm != null) 910 if (gm != null)
@@ -984,6 +992,7 @@ namespace OpenSim.Region.Framework.Scenes
984 Util.FireAndForget(delegate(object x) { 992 Util.FireAndForget(delegate(object x) {
985 foreach (SceneObjectGroup sog in m_attachments) 993 foreach (SceneObjectGroup sog in m_attachments)
986 { 994 {
995 sog.ScheduleGroupForFullUpdate();
987 sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource()); 996 sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource());
988 sog.ResumeScripts(); 997 sog.ResumeScripts();
989 } 998 }
@@ -991,6 +1000,8 @@ namespace OpenSim.Region.Framework.Scenes
991 } 1000 }
992 } 1001 }
993 1002
1003 SendAvatarDataToAllAgents();
1004
994 // send the animations of the other presences to me 1005 // send the animations of the other presences to me
995 m_scene.ForEachRootScenePresence(delegate(ScenePresence presence) 1006 m_scene.ForEachRootScenePresence(delegate(ScenePresence presence)
996 { 1007 {
@@ -1084,7 +1095,7 @@ namespace OpenSim.Region.Framework.Scenes
1084 } 1095 }
1085 1096
1086 /// <summary> 1097 /// <summary>
1087 /// 1098 /// Do not call this directly. Call Scene.RequestTeleportLocation() instead.
1088 /// </summary> 1099 /// </summary>
1089 /// <param name="pos"></param> 1100 /// <param name="pos"></param>
1090 public void Teleport(Vector3 pos) 1101 public void Teleport(Vector3 pos)
@@ -1558,7 +1569,10 @@ namespace OpenSim.Region.Framework.Scenes
1558 } 1569 }
1559 else if (bAllowUpdateMoveToPosition) 1570 else if (bAllowUpdateMoveToPosition)
1560 { 1571 {
1561 if (HandleMoveToTargetUpdate(ref agent_control_v3)) 1572 // The UseClientAgentPosition is set if parcel ban is forcing the avatar to move to a
1573 // certain position. It's only check for tolerance on returning to that position is 0.2
1574 // rather than 1, at which point it removes its force target.
1575 if (HandleMoveToTargetUpdate(agentData.UseClientAgentPosition ? 0.2 : 1, ref agent_control_v3))
1562 update_movementflag = true; 1576 update_movementflag = true;
1563 } 1577 }
1564 } 1578 }
@@ -1620,7 +1634,7 @@ namespace OpenSim.Region.Framework.Scenes
1620 /// </remarks> 1634 /// </remarks>
1621 /// <param value="agent_control_v3">Cumulative agent movement that this method will update.</param> 1635 /// <param value="agent_control_v3">Cumulative agent movement that this method will update.</param>
1622 /// <returns>True if movement has been updated in some way. False otherwise.</returns> 1636 /// <returns>True if movement has been updated in some way. False otherwise.</returns>
1623 public bool HandleMoveToTargetUpdate(ref Vector3 agent_control_v3) 1637 public bool HandleMoveToTargetUpdate(double tolerance, ref Vector3 agent_control_v3)
1624 { 1638 {
1625// m_log.DebugFormat("[SCENE PRESENCE]: Called HandleMoveToTargetUpdate() for {0}", Name); 1639// m_log.DebugFormat("[SCENE PRESENCE]: Called HandleMoveToTargetUpdate() for {0}", Name);
1626 1640
@@ -1637,7 +1651,7 @@ namespace OpenSim.Region.Framework.Scenes
1637// Name, AbsolutePosition, MoveToPositionTarget, distanceToTarget); 1651// Name, AbsolutePosition, MoveToPositionTarget, distanceToTarget);
1638 1652
1639 // Check the error term of the current position in relation to the target position 1653 // Check the error term of the current position in relation to the target position
1640 if (distanceToTarget <= 1) 1654 if (distanceToTarget <= tolerance)
1641 { 1655 {
1642 // We are close enough to the target 1656 // We are close enough to the target
1643 AbsolutePosition = MoveToPositionTarget; 1657 AbsolutePosition = MoveToPositionTarget;
@@ -1813,7 +1827,7 @@ namespace OpenSim.Region.Framework.Scenes
1813// m_log.DebugFormat("[SCENE PRESENCE]: Body rot for {0} set to {1}", Name, Rotation); 1827// m_log.DebugFormat("[SCENE PRESENCE]: Body rot for {0} set to {1}", Name, Rotation);
1814 1828
1815 Vector3 agent_control_v3 = new Vector3(); 1829 Vector3 agent_control_v3 = new Vector3();
1816 HandleMoveToTargetUpdate(ref agent_control_v3); 1830 HandleMoveToTargetUpdate(1, ref agent_control_v3);
1817 AddNewMovement(agent_control_v3); 1831 AddNewMovement(agent_control_v3);
1818 } 1832 }
1819 1833