If the prim count gets an object with invalid bounds, don't try to count it.

This appears to be the more probable explanation for some failures seen.  Either we're counting attachments which are temporarily out of bounds (shouldn't be due to the IsAttachment) check or we're counting scene objects which have out of bounds co-ordinates (seems more likely)
0.7.1-dev
Justin Clark-Casey (justincc) 2011-03-31 23:56:26 +01:00
parent 6ae76ede98
commit 4d0cffa06e
2 changed files with 8 additions and 3 deletions

View File

@ -766,9 +766,9 @@ namespace OpenSim.Region.CoreModules.World.Land
}
catch (IndexOutOfRangeException)
{
m_log.WarnFormat(
"[LAND MANAGEMENT MODULE]: Tried to retrieve land object from out of bounds co-ordinate ({0},{1}) in {2}",
x, y, m_scene.RegionInfo.RegionName);
// m_log.WarnFormat(
// "[LAND MANAGEMENT MODULE]: Tried to retrieve land object from out of bounds co-ordinate ({0},{1}) in {2}",
// x, y, m_scene.RegionInfo.RegionName);
return null;
}

View File

@ -183,6 +183,11 @@ namespace OpenSim.Region.CoreModules.World.Land
Vector3 pos = obj.AbsolutePosition;
ILandObject landObject = m_Scene.LandChannel.GetLandObject(pos.X, pos.Y);
// If for some reason there is no land object (perhaps the object is out of bounds) then we can't count it
if (landObject == null)
return;
LandData landData = landObject.LandData;
// m_log.DebugFormat(