aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs13
1 files changed, 13 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs
index 3b8debb..c49b0b9 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs
@@ -172,6 +172,13 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
172 try 172 try
173 { 173 {
174 ITerrainChannel channel = loader.Value.LoadFile(filename); 174 ITerrainChannel channel = loader.Value.LoadFile(filename);
175 if (channel.Width != Constants.RegionSize || channel.Height != Constants.RegionSize)
176 {
177 // TerrainChannel expects a RegionSize x RegionSize map, currently
178 throw new ArgumentException(String.Format("wrong size, use a file with size {0} x {1}",
179 Constants.RegionSize, Constants.RegionSize));
180 }
181 m_log.DebugFormat("[TERRAIN]: Loaded terrain, wd/ht: {0}/{1}", channel.Width, channel.Height);
175 m_scene.Heightmap = channel; 182 m_scene.Heightmap = channel;
176 m_channel = channel; 183 m_channel = channel;
177 UpdateRevertMap(); 184 UpdateRevertMap();
@@ -189,6 +196,12 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
189 throw new TerrainException( 196 throw new TerrainException(
190 String.Format("unable to load heightmap: file {0} not found (or permissions do not allow access", filename)); 197 String.Format("unable to load heightmap: file {0} not found (or permissions do not allow access", filename));
191 } 198 }
199 catch (ArgumentException e)
200 {
201 m_log.ErrorFormat("[TERRAIN]: Unable to load heightmap: {0}", e.Message);
202 throw new TerrainException(
203 String.Format("Unable to load heightmap: {0}", e.Message));
204 }
192 } 205 }
193 CheckForTerrainUpdates(); 206 CheckForTerrainUpdates();
194 m_log.Info("[TERRAIN]: File (" + filename + ") loaded successfully"); 207 m_log.Info("[TERRAIN]: File (" + filename + ") loaded successfully");