aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-05-09 00:11:10 +0100
committerJustin Clark-Casey (justincc)2012-05-09 00:11:10 +0100
commite5dbb652d5118d193de794fb948252195594b344 (patch)
tree676b27685d6f33bfb0cb4aea4055942ff818363b
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-e5dbb652d5118d193de794fb948252195594b344.zip
opensim-SC_OLD-e5dbb652d5118d193de794fb948252195594b344.tar.gz
opensim-SC_OLD-e5dbb652d5118d193de794fb948252195594b344.tar.bz2
opensim-SC_OLD-e5dbb652d5118d193de794fb948252195594b344.tar.xz
Remove physics actor related race conditions in SetVehicleFlags() and SetPhysicsAxisRotation()
sop.PhysActor can currently become null at any time.
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs16
1 files changed, 9 insertions, 7 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 4bec2d4..f911ef8 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -3321,10 +3321,10 @@ namespace OpenSim.Region.Framework.Scenes
3321 3321
3322 public void SetVehicleFlags(int param, bool remove) 3322 public void SetVehicleFlags(int param, bool remove)
3323 { 3323 {
3324 if (PhysActor != null) 3324 PhysicsActor pa = PhysActor;
3325 { 3325
3326 PhysActor.VehicleFlags(param, remove); 3326 if (pa != null)
3327 } 3327 pa.VehicleFlags(param, remove);
3328 } 3328 }
3329 3329
3330 public void SetGroup(UUID groupID, IClientAPI client) 3330 public void SetGroup(UUID groupID, IClientAPI client)
@@ -3356,10 +3356,12 @@ namespace OpenSim.Region.Framework.Scenes
3356 3356
3357 public void SetPhysicsAxisRotation() 3357 public void SetPhysicsAxisRotation()
3358 { 3358 {
3359 if (PhysActor != null) 3359 PhysicsActor pa = PhysActor;
3360
3361 if (pa != null)
3360 { 3362 {
3361 PhysActor.LockAngularMotion(RotationAxis); 3363 pa.LockAngularMotion(RotationAxis);
3362 ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); 3364 ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(pa);
3363 } 3365 }
3364 } 3366 }
3365 3367