Move a check for null PhysActor in applyImpulse so that attachments can move avatars.

Fixes Mantis #3160
0.6.5-rc1
idb 2009-03-21 11:42:31 +00:00
parent 14b94b8d05
commit 2d387c25b8
1 changed files with 9 additions and 9 deletions

View File

@ -1514,19 +1514,19 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart rootpart = m_rootPart; SceneObjectPart rootpart = m_rootPart;
if (rootpart != null) 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); avatar.PushForce(impulse);
if (avatar != null)
{
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); m_scene.PhysicsScene.AddPhysicsActorTaint(rootpart.PhysActor);
} }
} }