aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs12
1 files changed, 9 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index c94a57d..a745d9c 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -580,11 +580,17 @@ namespace OpenSim.Region.Environment.Scenes
580 580
581 public void applyImpulse(PhysicsVector impulse) 581 public void applyImpulse(PhysicsVector impulse)
582 { 582 {
583 // We check if rootpart is null here because scripts don't delete if you delete the host.
584 // This means that unfortunately, we can pass a null physics actor to Simulate!
585 // Make sure we don't do that!
583 SceneObjectPart rootpart = m_rootPart; 586 SceneObjectPart rootpart = m_rootPart;
584 if (m_rootPart.PhysActor != null) 587 if (rootpart != null)
585 { 588 {
586 m_rootPart.PhysActor.AddForce(impulse); 589 if (rootpart.PhysActor != null)
587 m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); 590 {
591 rootpart.PhysActor.AddForce(impulse);
592 m_scene.PhysicsScene.AddPhysicsActorTaint(rootpart.PhysActor);
593 }
588 } 594 }
589 } 595 }
590 596