From 3a0137cb45f87f19946dbfb531266539a881d56c Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 6 Sep 2015 16:36:30 +0100 Subject: fix odd drawdistance control initialization --- OpenSim/Region/Framework/Scenes/Scene.cs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index c5c2147..52e03b2 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -274,17 +274,7 @@ namespace OpenSim.Region.Framework.Scenes protected float m_defaultDrawDistance = 255f; public float DefaultDrawDistance { - // get { return m_defaultDrawDistance; } - get - { - if (RegionInfo != null) - { - float largestDimension = Math.Max(RegionInfo.RegionSizeX, RegionInfo.RegionSizeY); - m_defaultDrawDistance = Math.Max(m_defaultDrawDistance, largestDimension); - - } - return m_defaultDrawDistance; - } + get { return m_defaultDrawDistance; } } protected float m_maxDrawDistance = 512.0f; @@ -981,7 +971,11 @@ namespace OpenSim.Region.Framework.Scenes StartDisabled = startupConfig.GetBoolean("StartDisabled", false); m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance", m_defaultDrawDistance); - m_defaultDrawDistance = startupConfig.GetFloat("MaxDrawDistance", m_maxDrawDistance); + m_maxDrawDistance = startupConfig.GetFloat("MaxDrawDistance", m_maxDrawDistance); + + if (m_defaultDrawDistance > m_maxDrawDistance) + m_defaultDrawDistance = m_maxDrawDistance; + UseBackup = startupConfig.GetBoolean("UseSceneBackup", UseBackup); if (!UseBackup) m_log.InfoFormat("[SCENE]: Backup has been disabled for {0}", RegionInfo.RegionName); -- cgit v1.1