diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index c3279c6911..a4e5c1e529 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs @@ -221,7 +221,7 @@ namespace OpenSim.Region.Physics.OdePlugin /// /// A list of actors that should receive collision events. /// - private readonly List _collisionEventPrim = new List(); + private readonly Dictionary _collisionEventPrim = new Dictionary(); private readonly HashSet _badCharacter = new HashSet(); public Dictionary geom_name_map = new Dictionary(); @@ -1636,10 +1636,7 @@ namespace OpenSim.Region.Physics.OdePlugin // m_log.DebugFormat("[PHYSICS]: Adding {0} to collision event reporting", obj.SOPName); lock (_collisionEventPrim) - { - if (!_collisionEventPrim.Contains(obj)) - _collisionEventPrim.Add(obj); - } + _collisionEventPrim[obj.LocalID] = obj; } /// @@ -1651,7 +1648,7 @@ namespace OpenSim.Region.Physics.OdePlugin // m_log.DebugFormat("[PHYSICS]: Removing {0} from collision event reporting", obj.SOPName); lock (_collisionEventPrim) - _collisionEventPrim.Remove(obj); + _collisionEventPrim.Remove(obj.LocalID); } #region Add/Remove Entities @@ -2792,7 +2789,7 @@ Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name); lock (_collisionEventPrim) { - foreach (PhysicsActor obj in _collisionEventPrim) + foreach (PhysicsActor obj in _collisionEventPrim.Values) { // m_log.DebugFormat("[PHYSICS]: Assessing {0} for collision events", obj.SOPName);