add some safeguard checks

avinationmerge
UbitUmarov 2015-11-12 21:24:14 +00:00
parent 8c7f475740
commit 9bd6befdeb
1 changed files with 4 additions and 3 deletions

View File

@ -1131,7 +1131,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
{
foreach (OdeCharacter chr in _characters)
{
if (chr == null || chr.Body == IntPtr.Zero)
if (chr == null || chr.Body == IntPtr.Zero || chr.collider == IntPtr.Zero )
continue;
chr.IsColliding = false;
@ -1161,13 +1161,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde
aprim.IsColliding = false;
}
}
lock (_activeprims)
lock (_activegroups)
{
try
{
foreach (OdePrim aprim in _activegroups)
{
if(!aprim.m_outbounds && d.BodyIsEnabled(aprim.Body))
if(!aprim.m_outbounds && d.BodyIsEnabled(aprim.Body) &&
aprim.collide_geom != IntPtr.Zero)
{
d.SpaceCollide2(StaticSpace, aprim.collide_geom, IntPtr.Zero, nearCallback);
d.SpaceCollide2(GroundSpace, aprim.collide_geom, IntPtr.Zero, nearCallback);