diff options
Small refactoring on Terrain Update sending, so that other code can force terrain updates to be sent to clients.
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 35 |
1 files 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 | |||
718 | 718 | ||
719 | m_storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD(), RegionInfo.RegionID); | 719 | m_storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD(), RegionInfo.RegionID); |
720 | 720 | ||
721 | float[] terData = Terrain.GetHeights1D(); | 721 | SendTerrainUpdate(true); |
722 | |||
723 | Broadcast(delegate(IClientAPI client) | ||
724 | { | ||
725 | for (int x = 0; x < 16; x++) | ||
726 | { | ||
727 | for (int y = 0; y < 16; y++) | ||
728 | { | ||
729 | if (Terrain.IsTainted(x*16, y*16)) | ||
730 | { | ||
731 | client.SendLayerData(x, y, terData); | ||
732 | } | ||
733 | } | ||
734 | } | ||
735 | }); | ||
736 | 722 | ||
737 | Terrain.ResetTaint(); | 723 | Terrain.ResetTaint(); |
738 | } | 724 | } |
739 | } | 725 | } |
740 | } | 726 | } |
741 | 727 | ||
728 | public void SendTerrainUpdate(bool checkForTainted) | ||
729 | { | ||
730 | float[] terData = Terrain.GetHeights1D(); | ||
731 | |||
732 | Broadcast(delegate(IClientAPI client) | ||
733 | { | ||
734 | for (int x = 0; x < 16; x++) | ||
735 | { | ||
736 | for (int y = 0; y < 16; y++) | ||
737 | { | ||
738 | if ((!checkForTainted) || (Terrain.IsTainted(x * 16, y * 16))) | ||
739 | { | ||
740 | client.SendLayerData(x, y, terData); | ||
741 | } | ||
742 | } | ||
743 | } | ||
744 | }); | ||
745 | } | ||
746 | |||
742 | private void UpdateStorageBackup() | 747 | private void UpdateStorageBackup() |
743 | { | 748 | { |
744 | Backup(); | 749 | Backup(); |