aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/LandManagement/LandManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/LandManagement/LandManager.cs')
-rw-r--r--OpenSim/Region/Environment/LandManagement/LandManager.cs57
1 files changed, 51 insertions, 6 deletions
diff --git a/OpenSim/Region/Environment/LandManagement/LandManager.cs b/OpenSim/Region/Environment/LandManagement/LandManager.cs
index 47201f3..017fce8 100644
--- a/OpenSim/Region/Environment/LandManagement/LandManager.cs
+++ b/OpenSim/Region/Environment/LandManagement/LandManager.cs
@@ -310,7 +310,15 @@ namespace OpenSim.Region.Environment.LandManagement
310 { 310 {
311 //First, lets loop through the points and make sure they are all in the same peice of land 311 //First, lets loop through the points and make sure they are all in the same peice of land
312 //Get the land object at start 312 //Get the land object at start
313 Land startLandObject = getLandObject(start_x, start_y); 313 Land startLandObject = null;
314 try
315 {
316 startLandObject = getLandObject(start_x, start_y);
317 }
318 catch (Exception)
319 {
320 m_log.Error("[LAND]: " + "Unable to get land object for subdivision at x: " + start_x + " y:" + start_y);
321 }
314 if (startLandObject == null) return false; //No such land object at the beginning 322 if (startLandObject == null) return false; //No such land object at the beginning
315 323
316 //Loop through the points 324 //Loop through the points
@@ -386,7 +394,15 @@ namespace OpenSim.Region.Environment.LandManagement
386 { 394 {
387 for (stepXSelected = start_x; stepXSelected <= end_x; stepXSelected += 4) 395 for (stepXSelected = start_x; stepXSelected <= end_x; stepXSelected += 4)
388 { 396 {
389 Land p = getLandObject(stepXSelected, stepYSelected); 397 Land p = null;
398 try
399 {
400 p = getLandObject(stepXSelected, stepYSelected);
401 }
402 catch (Exception)
403 {
404 m_log.Error("[LAND]: " + "Unable to get land object for subdivision at x: " + stepXSelected + " y:" + stepYSelected);
405 }
390 if (p != null) 406 if (p != null)
391 { 407 {
392 if (!selectedLandObjects.Contains(p)) 408 if (!selectedLandObjects.Contains(p))
@@ -452,7 +468,18 @@ namespace OpenSim.Region.Environment.LandManagement
452 for (x = 0; x < 64; x++) 468 for (x = 0; x < 64; x++)
453 { 469 {
454 byte tempByte = (byte) 0; //This represents the byte for the current 4x4 470 byte tempByte = (byte) 0; //This represents the byte for the current 4x4
455 Land currentParcelBlock = getLandObject(x*4, y*4); 471 Land currentParcelBlock = null;
472
473 try
474 {
475 currentParcelBlock = getLandObject(x * 4, y * 4);
476 }
477 catch (Exception)
478 {
479 m_log.Warn("[LAND]: " + "unable to get land at x: " + (x * 4) + " y: " + (y * 4));
480 }
481
482
456 if (currentParcelBlock != null) 483 if (currentParcelBlock != null)
457 { 484 {
458 if (currentParcelBlock.landData.ownerID == remote_client.AgentId) 485 if (currentParcelBlock.landData.ownerID == remote_client.AgentId)
@@ -545,7 +572,16 @@ namespace OpenSim.Region.Environment.LandManagement
545 { 572 {
546 for (y = 0; y < inc_y; y++) 573 for (y = 0; y < inc_y; y++)
547 { 574 {
548 Land currentParcel = getLandObject(start_x + x, start_y + y); 575
576 Land currentParcel = null;
577 try
578 {
579 getLandObject(start_x + x, start_y + y);
580 }
581 catch (Exception)
582 {
583 m_log.Warn("[LAND]: " + "unable to get land at x: " + (start_x + x) + " y: " + (start_y + y));
584 }
549 if (currentParcel != null) 585 if (currentParcel != null)
550 { 586 {
551 if (!temp.Contains(currentParcel)) 587 if (!temp.Contains(currentParcel))
@@ -699,6 +735,7 @@ namespace OpenSim.Region.Environment.LandManagement
699 { 735 {
700 if (presence.UUID == avatar.AgentId) 736 if (presence.UUID == avatar.AgentId)
701 { 737 {
738
702 List<Land> checkLandParcels = parcelsNearPoint(presence.AbsolutePosition); 739 List<Land> checkLandParcels = parcelsNearPoint(presence.AbsolutePosition);
703 foreach (Land checkBan in checkLandParcels) 740 foreach (Land checkBan in checkLandParcels)
704 { 741 {
@@ -720,8 +757,16 @@ namespace OpenSim.Region.Environment.LandManagement
720 757
721 public void sendLandUpdate(ScenePresence avatar, bool force) 758 public void sendLandUpdate(ScenePresence avatar, bool force)
722 { 759 {
723 Land over = getLandObject((int) Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.X))), 760 Land over = null;
724 (int) Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.Y)))); 761 try
762 {
763 over = getLandObject((int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.X))),
764 (int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.Y))));
765 }
766 catch (Exception)
767 {
768 m_log.Warn("[LAND]: " + "unable to get land at x: " + Math.Round(avatar.AbsolutePosition.X) + " y: " + Math.Round(avatar.AbsolutePosition.Y));
769 }
725 770
726 if (over != null) 771 if (over != null)
727 { 772 {