diff options
*Fixed logic issue in LandManager that caused an 'invalid parcel' error to spew in the debug when land was selected
Diffstat (limited to 'OpenSim/Region/Environment/LandManagement/LandManager.cs')
-rw-r--r-- | OpenSim/Region/Environment/LandManagement/LandManager.cs | 17 |
1 files changed, 13 insertions, 4 deletions
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 | |||
459 | //Now for border control | 459 | //Now for border control |
460 | try | 460 | try |
461 | { | 461 | { |
462 | Land westParcel = getLandObject((x - 1) * 4, y * 4); | 462 | Land westParcel = null; |
463 | Land southParcel = getLandObject(x * 4, (y - 1) * 4); | 463 | Land southParcel = null; |
464 | if (x > 0) | ||
465 | { | ||
466 | westParcel = getLandObject((x - 1) * 4, y * 4); | ||
467 | } | ||
468 | if (y > 0) | ||
469 | { | ||
470 | southParcel = getLandObject(x * 4, (y - 1) * 4); | ||
471 | } | ||
472 | |||
464 | if (x == 0) | 473 | if (x == 0) |
465 | { | 474 | { |
466 | tempByte = Convert.ToByte(tempByte | LAND_FLAG_PROPERTY_BORDER_WEST); | 475 | tempByte = Convert.ToByte(tempByte | LAND_FLAG_PROPERTY_BORDER_WEST); |
@@ -492,9 +501,9 @@ namespace OpenSim.Region.Environment.LandManagement | |||
492 | byteArray = new byte[LAND_BLOCKS_PER_PACKET]; | 501 | byteArray = new byte[LAND_BLOCKS_PER_PACKET]; |
493 | } | 502 | } |
494 | } | 503 | } |
495 | catch (System.Exception) | 504 | catch (System.Exception e) |
496 | { | 505 | { |
497 | OpenSim.Framework.Console.MainLog.Instance.Debug("LAND", "Skipped Land checks because avatar is out of bounds"); | 506 | OpenSim.Framework.Console.MainLog.Instance.Debug("LAND", "Skipped Land checks because avatar is out of bounds: " + e.Message); |
498 | } | 507 | } |
499 | } | 508 | } |
500 | } | 509 | } |