diff options
author | Justin Clark-Casey (justincc) | 2011-10-15 02:07:05 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-10-15 02:07:05 +0100 |
commit | 732e9373795a35ed1965bbb93a02117fcf0a8c3e (patch) | |
tree | f190abcf9bcd4b13d00c4ed35a55f4d7d9fcff77 | |
parent | factor common code out into SOP.RemoveFromPhysics() (diff) | |
download | opensim-SC-732e9373795a35ed1965bbb93a02117fcf0a8c3e.zip opensim-SC-732e9373795a35ed1965bbb93a02117fcf0a8c3e.tar.gz opensim-SC-732e9373795a35ed1965bbb93a02117fcf0a8c3e.tar.bz2 opensim-SC-732e9373795a35ed1965bbb93a02117fcf0a8c3e.tar.xz |
refactor: Remove redundant code in SOP.UpdatePrimFlags()
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 48 |
1 files changed, 21 insertions, 27 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 822d54f..2659a69 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -4411,9 +4411,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4411 | if (ParentGroup.Scene == null) | 4411 | if (ParentGroup.Scene == null) |
4412 | return; | 4412 | return; |
4413 | 4413 | ||
4414 | PhysicsActor pa = PhysActor; | 4414 | if (PhysActor == null) |
4415 | |||
4416 | if (pa == null) | ||
4417 | { | 4415 | { |
4418 | // It's not phantom anymore. So make sure the physics engine get's knowledge of it | 4416 | // It's not phantom anymore. So make sure the physics engine get's knowledge of it |
4419 | PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape( | 4417 | PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape( |
@@ -4425,38 +4423,34 @@ namespace OpenSim.Region.Framework.Scenes | |||
4425 | UsePhysics, | 4423 | UsePhysics, |
4426 | m_localId); | 4424 | m_localId); |
4427 | 4425 | ||
4428 | pa = PhysActor; | 4426 | PhysActor.SetMaterial(Material); |
4429 | if (pa != null) | 4427 | DoPhysicsPropertyUpdate(UsePhysics, true); |
4430 | { | ||
4431 | PhysActor.SetMaterial(Material); | ||
4432 | DoPhysicsPropertyUpdate(UsePhysics, true); | ||
4433 | 4428 | ||
4434 | if (!m_parentGroup.IsDeleted) | 4429 | if (!m_parentGroup.IsDeleted) |
4430 | { | ||
4431 | if (LocalId == m_parentGroup.RootPart.LocalId) | ||
4435 | { | 4432 | { |
4436 | if (LocalId == m_parentGroup.RootPart.LocalId) | 4433 | m_parentGroup.CheckSculptAndLoad(); |
4437 | { | ||
4438 | m_parentGroup.CheckSculptAndLoad(); | ||
4439 | } | ||
4440 | } | 4434 | } |
4435 | } | ||
4441 | 4436 | ||
4442 | if ( | 4437 | if ( |
4443 | ((AggregateScriptEvents & scriptEvents.collision) != 0) || | 4438 | ((AggregateScriptEvents & scriptEvents.collision) != 0) || |
4444 | ((AggregateScriptEvents & scriptEvents.collision_end) != 0) || | 4439 | ((AggregateScriptEvents & scriptEvents.collision_end) != 0) || |
4445 | ((AggregateScriptEvents & scriptEvents.collision_start) != 0) || | 4440 | ((AggregateScriptEvents & scriptEvents.collision_start) != 0) || |
4446 | ((AggregateScriptEvents & scriptEvents.land_collision_start) != 0) || | 4441 | ((AggregateScriptEvents & scriptEvents.land_collision_start) != 0) || |
4447 | ((AggregateScriptEvents & scriptEvents.land_collision) != 0) || | 4442 | ((AggregateScriptEvents & scriptEvents.land_collision) != 0) || |
4448 | ((AggregateScriptEvents & scriptEvents.land_collision_end) != 0) || | 4443 | ((AggregateScriptEvents & scriptEvents.land_collision_end) != 0) || |
4449 | (CollisionSound != UUID.Zero) | 4444 | (CollisionSound != UUID.Zero) |
4450 | ) | 4445 | ) |
4451 | { | 4446 | { |
4452 | PhysActor.OnCollisionUpdate += PhysicsCollision; | 4447 | PhysActor.OnCollisionUpdate += PhysicsCollision; |
4453 | PhysActor.SubscribeEvents(1000); | 4448 | PhysActor.SubscribeEvents(1000); |
4454 | } | ||
4455 | } | 4449 | } |
4456 | } | 4450 | } |
4457 | else // it already has a physical representation | 4451 | else // it already has a physical representation |
4458 | { | 4452 | { |
4459 | pa.IsPhysical = UsePhysics; | 4453 | PhysActor.IsPhysical = UsePhysics; |
4460 | 4454 | ||
4461 | DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status. If it's phantom this will remove the prim | 4455 | DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status. If it's phantom this will remove the prim |
4462 | 4456 | ||