diff options
author | teravus | 2013-03-06 17:02:53 -0500 |
---|---|---|
committer | teravus | 2013-03-06 17:02:53 -0500 |
commit | f954c53ddb009009e386a4046857cc20d0fd656c (patch) | |
tree | ea288888875368fc0cae76c83aaa8e0574279504 /OpenSim/Region/Framework | |
parent | Merge branch 'avination' into careminster (diff) | |
download | opensim-SC-f954c53ddb009009e386a4046857cc20d0fd656c.zip opensim-SC-f954c53ddb009009e386a4046857cc20d0fd656c.tar.gz opensim-SC-f954c53ddb009009e386a4046857cc20d0fd656c.tar.bz2 opensim-SC-f954c53ddb009009e386a4046857cc20d0fd656c.tar.xz |
* Separate two if trees that got merged into one if tree with borked logic.
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 7cab841..e22cf47 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -4574,7 +4574,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
4574 | if (ParentGroup.RootPart == this) | 4574 | if (ParentGroup.RootPart == this) |
4575 | AngularVelocity = new Vector3(0, 0, 0); | 4575 | AngularVelocity = new Vector3(0, 0, 0); |
4576 | } | 4576 | } |
4577 | else if (SetVD != wasVD) | 4577 | |
4578 | else | ||
4578 | { | 4579 | { |
4579 | if (ParentGroup.Scene.CollidablePrims) | 4580 | if (ParentGroup.Scene.CollidablePrims) |
4580 | { | 4581 | { |
@@ -4620,9 +4621,31 @@ namespace OpenSim.Region.Framework.Scenes | |||
4620 | UpdatePhysicsSubscribedEvents(); | 4621 | UpdatePhysicsSubscribedEvents(); |
4621 | } | 4622 | } |
4622 | } | 4623 | } |
4623 | 4624 | if (SetVD) | |
4625 | { | ||
4626 | // If the above logic worked (this is urgent candidate to unit tests!) | ||
4627 | // we now have a physicsactor. | ||
4628 | // Defensive programming calls for a check here. | ||
4629 | // Better would be throwing an exception that could be catched by a unit test as the internal | ||
4630 | // logic should make sure, this Physactor is always here. | ||
4631 | if (pa != null) | ||
4632 | { | ||
4633 | pa.SetVolumeDetect(1); | ||
4634 | AddFlag(PrimFlags.Phantom); // We set this flag also if VD is active | ||
4635 | VolumeDetectActive = true; | ||
4636 | } | ||
4624 | // m_log.Debug("Update: PHY:" + UsePhysics.ToString() + ", T:" + IsTemporary.ToString() + ", PHA:" + IsPhantom.ToString() + " S:" + CastsShadows.ToString()); | 4637 | // m_log.Debug("Update: PHY:" + UsePhysics.ToString() + ", T:" + IsTemporary.ToString() + ", PHA:" + IsPhantom.ToString() + " S:" + CastsShadows.ToString()); |
4638 | } | ||
4639 | else if (SetVD != wasVD) | ||
4640 | { | ||
4641 | // Remove VolumeDetect in any case. Note, it's safe to call SetVolumeDetect as often as you like | ||
4642 | // (mumbles, well, at least if you have infinte CPU powers :-)) | ||
4643 | if (pa != null) | ||
4644 | pa.SetVolumeDetect(0); | ||
4625 | 4645 | ||
4646 | RemFlag(PrimFlags.Phantom); | ||
4647 | VolumeDetectActive = false; | ||
4648 | } | ||
4626 | // and last in case we have a new actor and not building | 4649 | // and last in case we have a new actor and not building |
4627 | 4650 | ||
4628 | if (ParentGroup != null) | 4651 | if (ParentGroup != null) |