From 542cd417c844f55f1337bfd924ab5f7b7e71c4a6 Mon Sep 17 00:00:00 2001 From: MW Date: Tue, 5 Feb 2008 15:03:08 +0000 Subject: Small refactoring on Terrain Update sending, so that other code can force terrain updates to be sent to clients. --- OpenSim/Region/Environment/Scenes/Scene.cs | 35 +++++++++++++++++------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index a80426b..1d688e3 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -718,27 +718,32 @@ namespace OpenSim.Region.Environment.Scenes m_storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD(), RegionInfo.RegionID); - float[] terData = Terrain.GetHeights1D(); - - Broadcast(delegate(IClientAPI client) - { - for (int x = 0; x < 16; x++) - { - for (int y = 0; y < 16; y++) - { - if (Terrain.IsTainted(x*16, y*16)) - { - client.SendLayerData(x, y, terData); - } - } - } - }); + SendTerrainUpdate(true); Terrain.ResetTaint(); } } } + public void SendTerrainUpdate(bool checkForTainted) + { + float[] terData = Terrain.GetHeights1D(); + + Broadcast(delegate(IClientAPI client) + { + for (int x = 0; x < 16; x++) + { + for (int y = 0; y < 16; y++) + { + if ((!checkForTainted) || (Terrain.IsTainted(x * 16, y * 16))) + { + client.SendLayerData(x, y, terData); + } + } + } + }); + } + private void UpdateStorageBackup() { Backup(); -- cgit v1.1