From 21e32196c7fa6824b0146142bda8a5c6b3f162a9 Mon Sep 17 00:00:00 2001 From: mingchen Date: Fri, 21 Dec 2007 21:04:27 +0000 Subject: *Fixed logic issue in LandManager that caused an 'invalid parcel' error to spew in the debug when land was selected --- .../Region/Environment/LandManagement/LandManager.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/LandManagement/LandManager.cs b/OpenSim/Region/Environment/LandManagement/LandManager.cs index 7e39b84..ecd458d 100644 --- a/OpenSim/Region/Environment/LandManagement/LandManager.cs +++ b/OpenSim/Region/Environment/LandManagement/LandManager.cs @@ -459,8 +459,17 @@ namespace OpenSim.Region.Environment.LandManagement //Now for border control try { - Land westParcel = getLandObject((x - 1) * 4, y * 4); - Land southParcel = getLandObject(x * 4, (y - 1) * 4); + Land westParcel = null; + Land southParcel = null; + if (x > 0) + { + westParcel = getLandObject((x - 1) * 4, y * 4); + } + if (y > 0) + { + southParcel = getLandObject(x * 4, (y - 1) * 4); + } + if (x == 0) { tempByte = Convert.ToByte(tempByte | LAND_FLAG_PROPERTY_BORDER_WEST); @@ -492,9 +501,9 @@ namespace OpenSim.Region.Environment.LandManagement byteArray = new byte[LAND_BLOCKS_PER_PACKET]; } } - catch (System.Exception) + catch (System.Exception e) { - OpenSim.Framework.Console.MainLog.Instance.Debug("LAND", "Skipped Land checks because avatar is out of bounds"); + OpenSim.Framework.Console.MainLog.Instance.Debug("LAND", "Skipped Land checks because avatar is out of bounds: " + e.Message); } } } -- cgit v1.1