aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs17
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs13
2 files changed, 20 insertions, 10 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 6187803..cf6e6af 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -4699,7 +4699,10 @@ namespace OpenSim.Region.Framework.Scenes
4699 Vector3? nearestPoint = GetNearestPointInParcelAlongDirectionFromPoint(avatar.AbsolutePosition, dir, nearestParcel); 4699 Vector3? nearestPoint = GetNearestPointInParcelAlongDirectionFromPoint(avatar.AbsolutePosition, dir, nearestParcel);
4700 if (nearestPoint != null) 4700 if (nearestPoint != null)
4701 { 4701 {
4702 Debug.WriteLine("Found a sane previous position based on velocity, sending them to: " + nearestPoint.ToString()); 4702// m_log.DebugFormat(
4703// "[SCENE]: Found a sane previous position based on velocity for {0}, sending them to {1} in {2}",
4704// avatar.Name, nearestPoint, nearestParcel.LandData.Name);
4705
4703 return nearestPoint.Value; 4706 return nearestPoint.Value;
4704 } 4707 }
4705 4708
@@ -4709,12 +4712,16 @@ namespace OpenSim.Region.Framework.Scenes
4709 nearestPoint = GetNearestPointInParcelAlongDirectionFromPoint(avatar.AbsolutePosition, dir, nearestParcel); 4712 nearestPoint = GetNearestPointInParcelAlongDirectionFromPoint(avatar.AbsolutePosition, dir, nearestParcel);
4710 if (nearestPoint != null) 4713 if (nearestPoint != null)
4711 { 4714 {
4712 Debug.WriteLine("They had a zero velocity, sending them to: " + nearestPoint.ToString()); 4715// m_log.DebugFormat(
4716// "[SCENE]: {0} had a zero velocity, sending them to {1}", avatar.Name, nearestPoint);
4717
4713 return nearestPoint.Value; 4718 return nearestPoint.Value;
4714 } 4719 }
4715 4720
4716 //Ultimate backup if we have no idea where they are 4721 //Ultimate backup if we have no idea where they are
4717 Debug.WriteLine("Have no idea where they are, sending them to: " + avatar.lastKnownAllowedPosition.ToString()); 4722// m_log.DebugFormat(
4723// "[SCENE]: No idea where {0} is, sending them to {1}", avatar.Name, avatar.lastKnownAllowedPosition);
4724
4718 return avatar.lastKnownAllowedPosition; 4725 return avatar.lastKnownAllowedPosition;
4719 } 4726 }
4720 4727
@@ -5120,7 +5127,7 @@ namespace OpenSim.Region.Framework.Scenes
5120// presence.Name, presence.AbsolutePosition, presence.MoveToPositionTarget); 5127// presence.Name, presence.AbsolutePosition, presence.MoveToPositionTarget);
5121 5128
5122 Vector3 agent_control_v3 = new Vector3(); 5129 Vector3 agent_control_v3 = new Vector3();
5123 presence.HandleMoveToTargetUpdate(ref agent_control_v3); 5130 presence.HandleMoveToTargetUpdate(1, ref agent_control_v3);
5124 presence.AddNewMovement(agent_control_v3); 5131 presence.AddNewMovement(agent_control_v3);
5125 } 5132 }
5126 } 5133 }
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 9cfdf9f..40c8d06 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1048,7 +1048,7 @@ namespace OpenSim.Region.Framework.Scenes
1048 } 1048 }
1049 1049
1050 /// <summary> 1050 /// <summary>
1051 /// 1051 /// Do not call this directly. Call Scene.RequestTeleportLocation() instead.
1052 /// </summary> 1052 /// </summary>
1053 /// <param name="pos"></param> 1053 /// <param name="pos"></param>
1054 public void Teleport(Vector3 pos) 1054 public void Teleport(Vector3 pos)
@@ -1522,7 +1522,10 @@ namespace OpenSim.Region.Framework.Scenes
1522 } 1522 }
1523 else if (bAllowUpdateMoveToPosition) 1523 else if (bAllowUpdateMoveToPosition)
1524 { 1524 {
1525 if (HandleMoveToTargetUpdate(ref agent_control_v3)) 1525 // The UseClientAgentPosition is set if parcel ban is forcing the avatar to move to a
1526 // certain position. It's only check for tolerance on returning to that position is 0.2
1527 // rather than 1, at which point it removes its force target.
1528 if (HandleMoveToTargetUpdate(agentData.UseClientAgentPosition ? 0.2 : 1, ref agent_control_v3))
1526 update_movementflag = true; 1529 update_movementflag = true;
1527 } 1530 }
1528 } 1531 }
@@ -1584,7 +1587,7 @@ namespace OpenSim.Region.Framework.Scenes
1584 /// </remarks> 1587 /// </remarks>
1585 /// <param value="agent_control_v3">Cumulative agent movement that this method will update.</param> 1588 /// <param value="agent_control_v3">Cumulative agent movement that this method will update.</param>
1586 /// <returns>True if movement has been updated in some way. False otherwise.</returns> 1589 /// <returns>True if movement has been updated in some way. False otherwise.</returns>
1587 public bool HandleMoveToTargetUpdate(ref Vector3 agent_control_v3) 1590 public bool HandleMoveToTargetUpdate(double tolerance, ref Vector3 agent_control_v3)
1588 { 1591 {
1589// m_log.DebugFormat("[SCENE PRESENCE]: Called HandleMoveToTargetUpdate() for {0}", Name); 1592// m_log.DebugFormat("[SCENE PRESENCE]: Called HandleMoveToTargetUpdate() for {0}", Name);
1590 1593
@@ -1601,7 +1604,7 @@ namespace OpenSim.Region.Framework.Scenes
1601// Name, AbsolutePosition, MoveToPositionTarget, distanceToTarget); 1604// Name, AbsolutePosition, MoveToPositionTarget, distanceToTarget);
1602 1605
1603 // Check the error term of the current position in relation to the target position 1606 // Check the error term of the current position in relation to the target position
1604 if (distanceToTarget <= 1) 1607 if (distanceToTarget <= tolerance)
1605 { 1608 {
1606 // We are close enough to the target 1609 // We are close enough to the target
1607 AbsolutePosition = MoveToPositionTarget; 1610 AbsolutePosition = MoveToPositionTarget;
@@ -1777,7 +1780,7 @@ namespace OpenSim.Region.Framework.Scenes
1777// m_log.DebugFormat("[SCENE PRESENCE]: Body rot for {0} set to {1}", Name, Rotation); 1780// m_log.DebugFormat("[SCENE PRESENCE]: Body rot for {0} set to {1}", Name, Rotation);
1778 1781
1779 Vector3 agent_control_v3 = new Vector3(); 1782 Vector3 agent_control_v3 = new Vector3();
1780 HandleMoveToTargetUpdate(ref agent_control_v3); 1783 HandleMoveToTargetUpdate(1, ref agent_control_v3);
1781 AddNewMovement(agent_control_v3); 1784 AddNewMovement(agent_control_v3);
1782 } 1785 }
1783 1786