diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Terrain')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index 69fa5f6..e21681d 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | |||
@@ -231,20 +231,27 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
231 | // Install terrain module in the simulator | 231 | // Install terrain module in the simulator |
232 | lock(m_scene) | 232 | lock(m_scene) |
233 | { | 233 | { |
234 | if(m_scene.Bakedmap != null) | ||
235 | { | ||
236 | m_baked = m_scene.Bakedmap; | ||
237 | } | ||
234 | if (m_scene.Heightmap == null) | 238 | if (m_scene.Heightmap == null) |
235 | { | 239 | { |
236 | m_channel = new TerrainChannel(m_InitialTerrain, (int)m_scene.RegionInfo.RegionSizeX, | 240 | if(m_baked != null) |
237 | (int)m_scene.RegionInfo.RegionSizeY, | 241 | m_channel = m_baked.MakeCopy(); |
238 | (int)m_scene.RegionInfo.RegionSizeZ); | 242 | else |
243 | m_channel = new TerrainChannel(m_InitialTerrain, | ||
244 | (int)m_scene.RegionInfo.RegionSizeX, | ||
245 | (int)m_scene.RegionInfo.RegionSizeY, | ||
246 | (int)m_scene.RegionInfo.RegionSizeZ); | ||
239 | m_scene.Heightmap = m_channel; | 247 | m_scene.Heightmap = m_channel; |
240 | |||
241 | UpdateBakedMap(); | ||
242 | } | 248 | } |
243 | else | 249 | else |
244 | { | 250 | { |
245 | m_channel = m_scene.Heightmap; | 251 | m_channel = m_scene.Heightmap; |
246 | UpdateBakedMap(); | ||
247 | } | 252 | } |
253 | if(m_baked == null) | ||
254 | UpdateBakedMap(); | ||
248 | 255 | ||
249 | m_scene.RegisterModuleInterface<ITerrainModule>(this); | 256 | m_scene.RegisterModuleInterface<ITerrainModule>(this); |
250 | m_scene.EventManager.OnNewClient += EventManager_OnNewClient; | 257 | m_scene.EventManager.OnNewClient += EventManager_OnNewClient; |
@@ -724,6 +731,8 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
724 | m_baked = m_channel.MakeCopy(); | 731 | m_baked = m_channel.MakeCopy(); |
725 | m_painteffects[StandardTerrainEffects.Revert] = new RevertSphere(m_baked); | 732 | m_painteffects[StandardTerrainEffects.Revert] = new RevertSphere(m_baked); |
726 | m_floodeffects[StandardTerrainEffects.Revert] = new RevertArea(m_baked); | 733 | m_floodeffects[StandardTerrainEffects.Revert] = new RevertArea(m_baked); |
734 | m_scene.Bakedmap = m_baked; | ||
735 | m_scene.SaveBakedTerrain(); | ||
727 | } | 736 | } |
728 | 737 | ||
729 | /// <summary> | 738 | /// <summary> |