Corrections for Avatar Auto-pilot target; add llStopMoveToTarget() for Avatar-attached.

This commit is contained in:
Kitto Flora
2011-02-04 17:31:52 +00:00
parent 35d29ef3e3
commit b6dda231f2
2 changed files with 55 additions and 5 deletions

View File

@@ -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;
}
}
}
}