From 4d0cffa06e1c4071d137834e1d5c2cd06c933441 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 31 Mar 2011 23:56:26 +0100 Subject: [PATCH] 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) --- .../Region/CoreModules/World/Land/LandManagementModule.cs | 6 +++--- OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index fac25741c6..2b5f7a037a 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -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; } diff --git a/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs b/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs index d1e2328728..f07ae31e1c 100644 --- a/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs @@ -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(