From c9eb051936ee8e3a6885c8e4614a7d381cb34314 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Thu, 6 Mar 2008 23:14:24 +0000 Subject: * Fix for exception in landmanager crash. --- OpenSim/Region/Environment/LandManagement/Land.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Environment/LandManagement') diff --git a/OpenSim/Region/Environment/LandManagement/Land.cs b/OpenSim/Region/Environment/LandManagement/Land.cs index 4c6168d..1eadccb 100644 --- a/OpenSim/Region/Environment/LandManagement/Land.cs +++ b/OpenSim/Region/Environment/LandManagement/Land.cs @@ -439,12 +439,25 @@ namespace OpenSim.Region.Environment.LandManagement } } } + int tx = min_x * 4; + if (tx > 255) + tx = 255; + int ty = min_y * 4; + if (ty > 255) + ty = 255; landData.AABBMin = new LLVector3((float)(min_x * 4), (float)(min_y * 4), - (float)m_scene.Heightmap[(min_x * 4), (min_y * 4)]); + (float)m_scene.Heightmap[tx, ty]); + + tx = max_x * 4; + if (tx > 255) + tx = 255; + ty = max_y * 4; + if (ty > 255) + ty = 255; landData.AABBMax = new LLVector3((float)(max_x * 4), (float)(max_y * 4), - (float)m_scene.Heightmap[(max_x * 4), (max_y * 4)]); + (float)m_scene.Heightmap[tx, ty]); landData.area = tempArea; } -- cgit v1.1