From e0f43cad4b86ff5810fef665dec55ac6868dee38 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Mon, 22 Oct 2007 03:22:27 +0000 Subject: update so that distances aren't required in the config file --- OpenSim/Region/Environment/Modules/ChatModule.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Modules/ChatModule.cs b/OpenSim/Region/Environment/Modules/ChatModule.cs index 4ead398..abd770a 100644 --- a/OpenSim/Region/Environment/Modules/ChatModule.cs +++ b/OpenSim/Region/Environment/Modules/ChatModule.cs @@ -58,10 +58,13 @@ namespace OpenSim.Region.Environment.Modules public void Initialise(Scene scene, Nini.Config.IConfigSource config) { - - m_whisperdistance = config.Configs["Chat"].GetInt("whisper_distance"); - m_saydistance = config.Configs["Chat"].GetInt("say_distance"); - m_shoutdistance = config.Configs["Chat"].GetInt("shout_distance"); + // wrap this in a try block so that defaults will work if + // the config file doesn't specify otherwise. + try { + m_whisperdistance = config.Configs["Chat"].GetInt("whisper_distance", m_whisperdistance); + m_saydistance = config.Configs["Chat"].GetInt("say_distance", m_saydistance); + m_shoutdistance = config.Configs["Chat"].GetInt("shout_distance", m_shoutdistance); + } catch (Exception e) {} if (!m_scenes.Contains(scene)) { -- cgit v1.1