From 2d387c25b834988f1a0ffd5429e0d1a0b7bc0222 Mon Sep 17 00:00:00 2001 From: idb Date: Sat, 21 Mar 2009 11:42:31 +0000 Subject: Move a check for null PhysActor in applyImpulse so that attachments can move avatars. Fixes Mantis #3160 --- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index debab8d..968f94b 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -1514,19 +1514,19 @@ namespace OpenSim.Region.Framework.Scenes SceneObjectPart rootpart = m_rootPart; if (rootpart != null) { - if (rootpart.PhysActor != null) + if (IsAttachment) { - if (IsAttachment) + ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar); + if (avatar != null) { - ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar); - if (avatar != null) - { - avatar.PushForce(impulse); - } + avatar.PushForce(impulse); } - else + } + else + { + if (rootpart.PhysActor != null) { - rootpart.PhysActor.AddForce(impulse,true); + rootpart.PhysActor.AddForce(impulse, true); m_scene.PhysicsScene.AddPhysicsActorTaint(rootpart.PhysActor); } } -- cgit v1.1