From ef0ac7c4032ebb369479c18a4f2cc432b613234f Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Sat, 26 Jun 2010 23:20:28 -0700 Subject: Deal with incoming land objects properly so they don't just stack up --- .../CoreModules/World/Land/LandManagementModule.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 91c8130..cfee1b0 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -1303,18 +1303,31 @@ namespace OpenSim.Region.CoreModules.World.Land public void EventManagerOnIncomingLandDataFromStorage(List data) { - for (int i = 0; i < data.Count; i++) + lock (m_landList) { - IncomingLandObjectFromStorage(data[i]); + //Remove all the land objects in the sim and then process our new data + foreach (int n in m_landList.Keys) + { + m_scene.EventManager.TriggerLandObjectRemoved(m_landList[n].LandData.GlobalID); + } + m_landIDList.Initialize(); + m_landList.Clear(); + + for (int i = 0; i < data.Count; i++) + { + IncomingLandObjectFromStorage(data[i]); + } } } public void IncomingLandObjectFromStorage(LandData data) { + ILandObject new_land = new LandObject(data.OwnerID, data.IsGroupOwned, m_scene); new_land.LandData = data.Copy(); new_land.SetLandBitmapFromByteArray(); AddLandObject(new_land); + new_land.SendLandUpdateToAvatarsOverMe(); } public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) -- cgit v1.1