aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules
diff options
context:
space:
mode:
authorHomer Horwitz2008-10-15 21:20:07 +0000
committerHomer Horwitz2008-10-15 21:20:07 +0000
commit641de2f40408ed8d1cbfed2d58b30e56d0f400ce (patch)
tree171d2dcb7120ee8a7db5498a8677ffe7b4142163 /OpenSim/Region/Environment/Modules
parentclean up a merge conflict and remove a console message (diff)
downloadopensim-SC-641de2f40408ed8d1cbfed2d58b30e56d0f400ce.zip
opensim-SC-641de2f40408ed8d1cbfed2d58b30e56d0f400ce.tar.gz
opensim-SC-641de2f40408ed8d1cbfed2d58b30e56d0f400ce.tar.bz2
opensim-SC-641de2f40408ed8d1cbfed2d58b30e56d0f400ce.tar.xz
Check for terrain size=256x256 on "terrain load <file>". This fixes
(the rest of) Mantis#1813.
Diffstat (limited to 'OpenSim/Region/Environment/Modules')
-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");