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 --- OpenSim/Region/ClientStack/ClientView.cs | 1 + .../Region/Environment/LandManagement/LandManager.cs | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index 10fd7ae..dba3682 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs @@ -1886,6 +1886,7 @@ namespace OpenSim.Region.ClientStack objdata.Sound = LLUUID.Zero; LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005")); objdata.TextureEntry = ntex.ToBytes(); + objdata.State = 0; objdata.Data = new byte[0]; 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