aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
diff options
context:
space:
mode:
authorUbitUmarov2018-10-20 19:49:37 +0100
committerUbitUmarov2018-10-20 19:49:37 +0100
commit4ca859b4fc5f0a9c8b99a10c3f9c191e86146373 (patch)
tree98c0b1146fc1c729e6789c1250949f823cc39675 /OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
parentoops (diff)
downloadopensim-SC-4ca859b4fc5f0a9c8b99a10c3f9c191e86146373.zip
opensim-SC-4ca859b4fc5f0a9c8b99a10c3f9c191e86146373.tar.gz
opensim-SC-4ca859b4fc5f0a9c8b99a10c3f9c191e86146373.tar.bz2
opensim-SC-4ca859b4fc5f0a9c8b99a10c3f9c191e86146373.tar.xz
mantis 8356: patched by hand, thx Lotek
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs11
1 files changed, 5 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 21311b0..423fbc7 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -567,7 +567,7 @@ namespace OpenSim.Region.Framework.Scenes
567 567
568 if (RootPart.GetStatusSandbox()) 568 if (RootPart.GetStatusSandbox())
569 { 569 {
570 if (Util.GetDistanceTo(RootPart.StatusSandboxPos, value) > 10) 570 if (Vector3.DistanceSquared(RootPart.StatusSandboxPos, value) > 100)
571 { 571 {
572 RootPart.ScriptSetPhysicsStatus(false); 572 RootPart.ScriptSetPhysicsStatus(false);
573 573
@@ -1994,7 +1994,6 @@ namespace OpenSim.Region.Framework.Scenes
1994 public void SaveScriptedState(XmlTextWriter writer, bool oldIDs) 1994 public void SaveScriptedState(XmlTextWriter writer, bool oldIDs)
1995 { 1995 {
1996 XmlDocument doc = new XmlDocument(); 1996 XmlDocument doc = new XmlDocument();
1997 doc.XmlResolver=null;
1998 Dictionary<UUID,string> states = new Dictionary<UUID,string>(); 1997 Dictionary<UUID,string> states = new Dictionary<UUID,string>();
1999 1998
2000 SceneObjectPart[] parts = m_parts.GetArray(); 1999 SceneObjectPart[] parts = m_parts.GetArray();
@@ -2783,14 +2782,14 @@ namespace OpenSim.Region.Framework.Scenes
2783 return RootPart.Torque; 2782 return RootPart.Torque;
2784 } 2783 }
2785 2784
2786 // This is used by llMoveToTarget() in an attached object 2785 // This is used by both Double-Click Auto-Pilot and llMoveToTarget() in an attached object
2787 public void MoveToTarget(Vector3 target, float tau) 2786 public void MoveToTarget(Vector3 target, float tau)
2788 { 2787 {
2789 if (IsAttachment) 2788 if (IsAttachment)
2790 { 2789 {
2791 ScenePresence avatar = m_scene.GetScenePresence(AttachedAvatar); 2790 ScenePresence avatar = m_scene.GetScenePresence(AttachedAvatar);
2792 2791
2793 if (avatar != null) 2792 if (avatar != null && !avatar.IsSatOnObject)
2794 avatar.MoveToTarget(target, false, false, tau); 2793 avatar.MoveToTarget(target, false, false, tau);
2795 } 2794 }
2796 else 2795 else
@@ -4531,7 +4530,7 @@ namespace OpenSim.Region.Framework.Scenes
4531 4530
4532 if (RootPart.GetStatusSandbox()) 4531 if (RootPart.GetStatusSandbox())
4533 { 4532 {
4534 if (Util.GetDistanceTo(RootPart.StatusSandboxPos, pos) > 10) 4533 if (Vector3.DistanceSquared(RootPart.StatusSandboxPos, pos) > 100)
4535 { 4534 {
4536 RootPart.ScriptSetPhysicsStatus(false); 4535 RootPart.ScriptSetPhysicsStatus(false);
4537 pos = AbsolutePosition; 4536 pos = AbsolutePosition;
@@ -5029,7 +5028,7 @@ namespace OpenSim.Region.Framework.Scenes
5029 foreach (uint idx in m_targets.Keys) 5028 foreach (uint idx in m_targets.Keys)
5030 { 5029 {
5031 scriptPosTarget target = m_targets[idx]; 5030 scriptPosTarget target = m_targets[idx];
5032 if (Util.GetDistanceTo(target.targetPos, m_rootPart.GroupPosition) <= target.tolerance) 5031 if (Vector3.DistanceSquared(target.targetPos, m_rootPart.GroupPosition) <= target.tolerance * target.tolerance)
5033 { 5032 {
5034 at_target = true; 5033 at_target = true;
5035 5034