Small refactoring on Terrain Update sending, so that other code can force terrain updates to be sent to clients.

ThreadPoolClientBranch
MW 2008-02-05 15:03:08 +00:00
parent 33c4631c6d
commit 542cd417c8
1 changed files with 20 additions and 15 deletions

View File

@ -718,6 +718,15 @@ namespace OpenSim.Region.Environment.Scenes
m_storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD(), RegionInfo.RegionID);
SendTerrainUpdate(true);
Terrain.ResetTaint();
}
}
}
public void SendTerrainUpdate(bool checkForTainted)
{
float[] terData = Terrain.GetHeights1D();
Broadcast(delegate(IClientAPI client)
@ -726,17 +735,13 @@ namespace OpenSim.Region.Environment.Scenes
{
for (int y = 0; y < 16; y++)
{
if (Terrain.IsTainted(x*16, y*16))
if ((!checkForTainted) || (Terrain.IsTainted(x * 16, y * 16)))
{
client.SendLayerData(x, y, terData);
}
}
}
});
Terrain.ResetTaint();
}
}
}
private void UpdateStorageBackup()