From 84602c9480a14e6397381ea40a387a609ada1dbf Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Wed, 22 Apr 2009 14:44:19 +0000 Subject: Thank you kindly, Marcus Llewellyn, for a patch that: An attachment with the physical checkbox checked will not allow the phantom checkbox to be cleared. This interfers with scripting functions such as llMoveToTarget(), which won't work while an object is phantom. If the prim containing the script is rezzed to the ground, it will then allow the phantom checlbox to be cleared, and the script works as expected. --- .../Region/Framework/Scenes/SceneObjectGroup.cs | 28 ++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 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 8e4a9d3..2552a3d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -1596,11 +1596,31 @@ namespace OpenSim.Region.Framework.Scenes SceneObjectPart rootpart = m_rootPart; if (rootpart != null) { - if (rootpart.PhysActor != null) + if (IsAttachment) { - rootpart.PhysActor.PIDTarget = new PhysicsVector(target.X, target.Y, target.Z); - rootpart.PhysActor.PIDTau = tau; - rootpart.PhysActor.PIDActive = true; + ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar); + if (avatar != null) + { + List coords = new List(); + uint regionX = 0; + uint regionY = 0; + Utils.LongToUInts(Scene.RegionInfo.RegionHandle, out regionX, out regionY); + target.X += regionX; + target.Y += regionY; + coords.Add(target.X.ToString()); + coords.Add(target.Y.ToString()); + coords.Add(target.Z.ToString()); + avatar.DoMoveToPosition(avatar, "", coords); + } + } + else + { + if (rootpart.PhysActor != null) + { + rootpart.PhysActor.PIDTarget = new PhysicsVector(target.X, target.Y, target.Z); + rootpart.PhysActor.PIDTau = tau; + rootpart.PhysActor.PIDActive = true; + } } } } -- cgit v1.1