From 67e56872f3529e5e2b1bf6b6f548bc00fec129e7 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey Date: Wed, 19 Nov 2014 19:08:33 +0000 Subject: If llStopMoveToTarget() is called on an attachment, then stop the avatar if it was moving to target. Same behaviour as on Linden Lab grid. Will probably also address http://opensimulator.org/mantis/view.php?id=7369 by not generating spurious object updates when llStopMoveToTarget() is called in attachments where the avatar is not moving. --- .../Region/Framework/Scenes/SceneObjectGroup.cs | 24 +++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 8535587..167485e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -1891,10 +1891,9 @@ namespace OpenSim.Region.Framework.Scenes if (IsAttachment) { ScenePresence avatar = m_scene.GetScenePresence(AttachedAvatar); + if (avatar != null) - { avatar.MoveToTarget(target, false, false); - } } else { @@ -1911,10 +1910,25 @@ namespace OpenSim.Region.Framework.Scenes public void stopMoveToTarget() { - PhysicsActor pa = RootPart.PhysActor; + if (IsAttachment) + { + ScenePresence avatar = m_scene.GetScenePresence(AttachedAvatar); - if (pa != null) - pa.PIDActive = false; + if (avatar != null) + avatar.ResetMoveToTarget(); + } + else + { + PhysicsActor pa = RootPart.PhysActor; + + if (pa != null) + { + pa.PIDActive = false; + + ScheduleGroupForTerseUpdate(); + //ParentGroup.ScheduleGroupForFullUpdate(); + } + } } /// -- cgit v1.1