aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs28
1 files changed, 24 insertions, 4 deletions
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
1596 SceneObjectPart rootpart = m_rootPart; 1596 SceneObjectPart rootpart = m_rootPart;
1597 if (rootpart != null) 1597 if (rootpart != null)
1598 { 1598 {
1599 if (rootpart.PhysActor != null) 1599 if (IsAttachment)
1600 { 1600 {
1601 rootpart.PhysActor.PIDTarget = new PhysicsVector(target.X, target.Y, target.Z); 1601 ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar);
1602 rootpart.PhysActor.PIDTau = tau; 1602 if (avatar != null)
1603 rootpart.PhysActor.PIDActive = true; 1603 {
1604 List<string> coords = new List<string>();
1605 uint regionX = 0;
1606 uint regionY = 0;
1607 Utils.LongToUInts(Scene.RegionInfo.RegionHandle, out regionX, out regionY);
1608 target.X += regionX;
1609 target.Y += regionY;
1610 coords.Add(target.X.ToString());
1611 coords.Add(target.Y.ToString());
1612 coords.Add(target.Z.ToString());
1613 avatar.DoMoveToPosition(avatar, "", coords);
1614 }
1615 }
1616 else
1617 {
1618 if (rootpart.PhysActor != null)
1619 {
1620 rootpart.PhysActor.PIDTarget = new PhysicsVector(target.X, target.Y, target.Z);
1621 rootpart.PhysActor.PIDTau = tau;
1622 rootpart.PhysActor.PIDActive = true;
1623 }
1604 } 1624 }
1605 } 1625 }
1606 } 1626 }