diff options
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 057e204..a2c7c83 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -679,6 +679,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
679 | public void removeLandObject(int local_id) | 679 | public void removeLandObject(int local_id) |
680 | { | 680 | { |
681 | ILandObject land; | 681 | ILandObject land; |
682 | UUID landGlobalID = UUID.Zero; | ||
682 | lock (m_landList) | 683 | lock (m_landList) |
683 | { | 684 | { |
684 | for (int x = 0; x < m_landIDList.GetLength(0); x++) | 685 | for (int x = 0; x < m_landIDList.GetLength(0); x++) |
@@ -697,12 +698,18 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
697 | 698 | ||
698 | land = m_landList[local_id]; | 699 | land = m_landList[local_id]; |
699 | m_landList.Remove(local_id); | 700 | m_landList.Remove(local_id); |
700 | if(land.LandData != null) | 701 | if(land != null && land.LandData != null) |
701 | m_landUUIDList.Remove(land.LandData.GlobalID); | 702 | { |
702 | land.Clear(); | 703 | landGlobalID = land.LandData.GlobalID; |
704 | m_landUUIDList.Remove(landGlobalID); | ||
705 | } | ||
703 | } | 706 | } |
704 | 707 | ||
705 | m_scene.EventManager.TriggerLandObjectRemoved(land.LandData.GlobalID); | 708 | if(landGlobalID != UUID.Zero) |
709 | { | ||
710 | m_scene.EventManager.TriggerLandObjectRemoved(landGlobalID); | ||
711 | land.Clear(); | ||
712 | } | ||
706 | } | 713 | } |
707 | 714 | ||
708 | /// <summary> | 715 | /// <summary> |