public void LoadMap(string mapName)
{
try {
map = Map.Load(this, mapName);
} catch (Exception ex) {
log.Log("Could not open the specified file ({0}): {1}", LogType.Error, mapName, ex.Message);
}
// or generate a default one
if (map == null)
{
log.Log("World.Init: Generating default flatgrass level.", LogType.SystemActivity);
map = new Map(this, 64, 64, 64);
map.spawn.Set(map.widthX / 2 * 32 + 16, map.widthY / 2 * 32 + 16, map.height * 32, 0, 0);
MapCommands.GenerateFlatgrass(map, false);
if (!map.Save())
{
throw new Exception("Could not save file.");
}
}
}