From 640ad259d4ee1bd9cdf56714f857811c73b09383 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Thu, 21 Feb 2008 14:51:39 +0000 Subject: [PATCH] * A few additional null checks in the Physics Scene and PhysicsActor so we don't try to enumerate dead null ODECharacter objects when things get *really* slow. --- OpenSim/Region/Physics/Manager/PhysicsActor.cs | 11 ++--------- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 6 ++++-- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs index f44c1608cd..7e88479a55 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs @@ -139,10 +139,9 @@ namespace OpenSim.Region.Physics.Manager if (handler != null) { - lock (handler) - { + handler(); - } + } } @@ -154,10 +153,7 @@ namespace OpenSim.Region.Physics.Manager OutOfBounds handler = OnOutOfBounds; if (handler != null) { - lock (handler) - { handler(pos); - } } } @@ -167,10 +163,7 @@ namespace OpenSim.Region.Physics.Manager if (handler != null) { - lock (handler) - { handler(e); - } } } diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index a8ee20d969..b3780fd36d 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -1272,7 +1272,8 @@ namespace OpenSim.Region.Physics.OdePlugin { foreach (OdeCharacter actor in _characters) { - actor.Move(timeStep); + if (actor != null) + actor.Move(timeStep); } collision_optimized(timeStep); @@ -1300,7 +1301,8 @@ namespace OpenSim.Region.Physics.OdePlugin foreach (OdeCharacter actor in _characters) { - actor.UpdatePositionAndVelocity(); + if (actor != null) + actor.UpdatePositionAndVelocity(); } if (!ode.lockquery())