diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index daf711c..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 | ||
@@ -3223,7 +3226,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3223 | ((SceneObjectGroup)so).LocalId = 0; | 3226 | ((SceneObjectGroup)so).LocalId = 0; |
3224 | ((SceneObjectGroup)so).RootPart.ClearUpdateSchedule(); | 3227 | ((SceneObjectGroup)so).RootPart.ClearUpdateSchedule(); |
3225 | so.SetState(cAgent.AttachmentObjectStates[i++], m_scene); | 3228 | so.SetState(cAgent.AttachmentObjectStates[i++], m_scene); |
3226 | m_scene.IncomingCreateObject(so); | 3229 | m_scene.IncomingCreateObject(Vector3.Zero, so); |
3227 | } | 3230 | } |
3228 | } | 3231 | } |
3229 | } | 3232 | } |