From 89b5d939398eed85a1c8773d8a11780c10bffbf3 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 15 Jun 2014 13:03:39 +0900 Subject: [PATCH] Check for GalaxyCubeControl being initialized. DarkenSky NREs during KSP startup due to attempting to adjust the galaxy box too early, so check to make sure it has been initialized before doing anything. --- Source-Code/DarkenSky.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source-Code/DarkenSky.cs b/Source-Code/DarkenSky.cs index fd54758..ae11a96 100644 --- a/Source-Code/DarkenSky.cs +++ b/Source-Code/DarkenSky.cs @@ -16,6 +16,9 @@ class DarkenSky : MonoBehaviour public void Awake() { + if (GalaxyCubeControl.Instance == null) + return; + //Load settings ConfigNode settings = ConfigNode.Load(KSPUtil.ApplicationRootPath + "GameData/DistantObject/Settings.cfg"); foreach (ConfigNode node in settings.GetNodes("SkyboxBrightness"))