From b6dda231f2d6be6ac7684048a11f1f0516ed3067 Mon Sep 17 00:00:00 2001 From: Kitto Flora Date: Fri, 4 Feb 2011 17:31:52 +0000 Subject: Corrections for Avatar Auto-pilot target; add llStopMoveToTarget() for Avatar-attached. --- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 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 6e0fc43..4cbf3e1 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -1912,6 +1912,7 @@ namespace OpenSim.Region.Framework.Scenes return Vector3.Zero; } + // This is used by both Double-Click Auto-Pilot and llMoveToTarget() in an attached object public void moveToTarget(Vector3 target, float tau) { SceneObjectPart rootpart = m_rootPart; @@ -1951,9 +1952,17 @@ namespace OpenSim.Region.Framework.Scenes SceneObjectPart rootpart = m_rootPart; if (rootpart != null) { - if (rootpart.PhysActor != null) + if (IsAttachment) { - rootpart.PhysActor.PIDActive = false; + ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar); + if (avatar != null) avatar.StopMoveToPosition(); + } + else + { + if (rootpart.PhysActor != null) + { + rootpart.PhysActor.PIDActive = false; + } } } } -- cgit v1.1