mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 02:05:34 +08:00
* 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.
This commit is contained in:
@@ -417,10 +417,27 @@ namespace OpenSim.world
|
||||
float[] map = this.localStorage.LoadWorld();
|
||||
if (map == null)
|
||||
{
|
||||
Console.WriteLine("creating new terrain");
|
||||
this.Terrain.hills();
|
||||
if (string.IsNullOrEmpty(this.m_regInfo.TerrainFile))
|
||||
{
|
||||
Console.WriteLine("No default terrain, procedurally generating...");
|
||||
this.Terrain.hills();
|
||||
|
||||
this.localStorage.SaveMap(this.Terrain.getHeights1D());
|
||||
this.localStorage.SaveMap(this.Terrain.getHeights1D());
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
this.Terrain.loadFromFileF32(this.m_regInfo.TerrainFile);
|
||||
this.Terrain *= this.m_regInfo.TerrainMultiplier;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("Unable to load default terrain (" + e.ToString() + "), procedurally generating instead...");
|
||||
Terrain.hills();
|
||||
}
|
||||
this.localStorage.SaveMap(this.Terrain.getHeights1D());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user