aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/OpenSim.RegionServer/world/World.cs
diff options
context:
space:
mode:
authorAdam Frisby2007-05-27 06:36:33 +0000
committerAdam Frisby2007-05-27 06:36:33 +0000
commit7a2abbb8484c8ceba990b3f5b79a0b5291c71e46 (patch)
tree9b940ab87255cfba9062c46ead6efbae80dfa640 /OpenSim/OpenSim.RegionServer/world/World.cs
parent* Terrain now resends when it's been tainted. This means you should be able t... (diff)
downloadopensim-SC_OLD-7a2abbb8484c8ceba990b3f5b79a0b5291c71e46.zip
opensim-SC_OLD-7a2abbb8484c8ceba990b3f5b79a0b5291c71e46.tar.gz
opensim-SC_OLD-7a2abbb8484c8ceba990b3f5b79a0b5291c71e46.tar.bz2
opensim-SC_OLD-7a2abbb8484c8ceba990b3f5b79a0b5291c71e46.tar.xz
* Added ability to set default terrain to a file in region config. If unable to open, terrain will be procedurally generated instead. (also needs testing.). Default file must be in R32 format. Use "terrain save f32 default.r32" on the region console to make a default file you can use.
Diffstat (limited to 'OpenSim/OpenSim.RegionServer/world/World.cs')
-rw-r--r--OpenSim/OpenSim.RegionServer/world/World.cs23
1 files changed, 20 insertions, 3 deletions
diff --git a/OpenSim/OpenSim.RegionServer/world/World.cs b/OpenSim/OpenSim.RegionServer/world/World.cs
index 68516d2..ef6833c 100644
--- a/OpenSim/OpenSim.RegionServer/world/World.cs
+++ b/OpenSim/OpenSim.RegionServer/world/World.cs
@@ -417,10 +417,27 @@ namespace OpenSim.world
417 float[] map = this.localStorage.LoadWorld(); 417 float[] map = this.localStorage.LoadWorld();
418 if (map == null) 418 if (map == null)
419 { 419 {
420 Console.WriteLine("creating new terrain"); 420 if (string.IsNullOrEmpty(this.m_regInfo.TerrainFile))
421 this.Terrain.hills(); 421 {
422 Console.WriteLine("No default terrain, procedurally generating...");
423 this.Terrain.hills();
422 424
423 this.localStorage.SaveMap(this.Terrain.getHeights1D()); 425 this.localStorage.SaveMap(this.Terrain.getHeights1D());
426 }
427 else
428 {
429 try
430 {
431 this.Terrain.loadFromFileF32(this.m_regInfo.TerrainFile);
432 this.Terrain *= this.m_regInfo.TerrainMultiplier;
433 }
434 catch (Exception e)
435 {
436 Console.WriteLine("Unable to load default terrain (" + e.ToString() + "), procedurally generating instead...");
437 Terrain.hills();
438 }
439 this.localStorage.SaveMap(this.Terrain.getHeights1D());
440 }
424 } 441 }
425 else 442 else
426 { 443 {