From 3e5ea796aecc045c09356d16b4004a5b9a753f96 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Fri, 9 Nov 2007 20:02:44 +0000 Subject: [PATCH] don't break if they haven't defined the Sun section of their config --- OpenSim/Region/Environment/Modules/SunModule.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Environment/Modules/SunModule.cs b/OpenSim/Region/Environment/Modules/SunModule.cs index d8b1ec9cc1..35987986b5 100644 --- a/OpenSim/Region/Environment/Modules/SunModule.cs +++ b/OpenSim/Region/Environment/Modules/SunModule.cs @@ -54,8 +54,16 @@ namespace OpenSim.Region.Environment.Modules { m_start = DateTime.Now.Ticks; m_frame = 0; - m_day_length = config.Configs["Sun"].GetDouble("day_length", 0.5); - m_frame_mod = config.Configs["Sun"].GetInt("frame_rate", 100); + + // Just in case they don't have the stanzas + try { + m_day_length = config.Configs["Sun"].GetDouble("day_length", 0.5); + m_frame_mod = config.Configs["Sun"].GetInt("frame_rate", 100); + } catch (Exception e) { + m_day_length = 0.5; + m_frame_mod = 100; + } + m_dilation = (int)(m_real_day / m_day_length); m_scene = scene; m_log = MainLog.Instance;