From df21da6decff40793acb1f7667b7ea111faab7e3 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 13 Feb 2008 16:35:42 +0000 Subject: [PATCH] * Patch from Dr Schofld's (IBM). In his own words all TerrainEngine.LoadFromFileX(string filename) methods don't set the dirty bits in heightmap.diff[,] in contrast to the TerrainEngine.LoadFromFileX(string filename, int dimensionX, int dimensionY, int lowerboundX, int lowerboundY) cousins. this has the unpleasant drawback that the Scene.SendTerrainUpdate(bool) will not send layer data to the client. the attached patch fixes all LoadFromFileX(.) methods. Thanks! * Also small build fix for AvatarFactoryModule --- OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs | 4 +++- OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs b/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs index b8b6be880a..6042a5435b 100644 --- a/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs +++ b/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs @@ -178,9 +178,11 @@ namespace OpenSim.Region.Environment.Modules if (m_avatarsAppearance.ContainsKey(clientView.AgentId)) { + AvatarAppearance avatAppearance = null; + lock (m_avatarsAppearance) { - AvatarAppearance avatAppearance = m_avatarsAppearance[clientView.AgentId]; + avatAppearance = m_avatarsAppearance[clientView.AgentId]; } avatAppearance.Wearables[wear.Type].AssetID = assetId; avatAppearance.Wearables[wear.Type].ItemID = wear.ItemID; diff --git a/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs b/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs index d4f4948770..82969d98b4 100644 --- a/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs +++ b/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs @@ -817,7 +817,7 @@ namespace OpenSim.Region.Terrain { for (x = 0; x < h; x++) { - heightmap.map[x, y] = bs.ReadDouble(); + heightmap.Set(x, y, (double) bs.ReadSingle()); } } @@ -842,7 +842,7 @@ namespace OpenSim.Region.Terrain { for (x = 0; x < w; x++) { - heightmap.map[x, y] = (double) bs.ReadSingle(); + heightmap.Set(x, y, (double) bs.ReadSingle()); } } @@ -954,7 +954,7 @@ namespace OpenSim.Region.Terrain { for (x = 0; x < w; x++) { - heightmap.map[x, y] = (double) bs.ReadByte()*((double) bs.ReadByte()/127.0); + heightmap.Set(x, y, (double) bs.ReadByte()*((double) bs.ReadByte()/127.0)); bs.ReadBytes(11); // Advance the stream to next bytes. } }