From 4ca859b4fc5f0a9c8b99a10c3f9c191e86146373 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 20 Oct 2018 19:49:37 +0100 Subject: mantis 8356: patched by hand, thx Lotek --- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs') 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 if (RootPart.GetStatusSandbox()) { - if (Util.GetDistanceTo(RootPart.StatusSandboxPos, value) > 10) + if (Vector3.DistanceSquared(RootPart.StatusSandboxPos, value) > 100) { RootPart.ScriptSetPhysicsStatus(false); @@ -1994,7 +1994,6 @@ namespace OpenSim.Region.Framework.Scenes public void SaveScriptedState(XmlTextWriter writer, bool oldIDs) { XmlDocument doc = new XmlDocument(); - doc.XmlResolver=null; Dictionary states = new Dictionary(); SceneObjectPart[] parts = m_parts.GetArray(); @@ -2783,14 +2782,14 @@ namespace OpenSim.Region.Framework.Scenes return RootPart.Torque; } - // This is used by llMoveToTarget() in an attached object + // This is used by both Double-Click Auto-Pilot and llMoveToTarget() in an attached object public void MoveToTarget(Vector3 target, float tau) { if (IsAttachment) { ScenePresence avatar = m_scene.GetScenePresence(AttachedAvatar); - if (avatar != null) + if (avatar != null && !avatar.IsSatOnObject) avatar.MoveToTarget(target, false, false, tau); } else @@ -4531,7 +4530,7 @@ namespace OpenSim.Region.Framework.Scenes if (RootPart.GetStatusSandbox()) { - if (Util.GetDistanceTo(RootPart.StatusSandboxPos, pos) > 10) + if (Vector3.DistanceSquared(RootPart.StatusSandboxPos, pos) > 100) { RootPart.ScriptSetPhysicsStatus(false); pos = AbsolutePosition; @@ -5029,7 +5028,7 @@ namespace OpenSim.Region.Framework.Scenes foreach (uint idx in m_targets.Keys) { scriptPosTarget target = m_targets[idx]; - if (Util.GetDistanceTo(target.targetPos, m_rootPart.GroupPosition) <= target.tolerance) + if (Vector3.DistanceSquared(target.targetPos, m_rootPart.GroupPosition) <= target.tolerance * target.tolerance) { at_target = true; -- cgit v1.1