diff --git a/NewHorizons/Components/Props/NHSupernovaPlanetEffectController.cs b/NewHorizons/Components/Props/NHSupernovaPlanetEffectController.cs index df1ebc7bd..0f87cca32 100644 --- a/NewHorizons/Components/Props/NHSupernovaPlanetEffectController.cs +++ b/NewHorizons/Components/Props/NHSupernovaPlanetEffectController.cs @@ -184,7 +184,7 @@ public void Update() { float collapseProgress = SunController.GetCollapseProgress(); - if (_ambientLight != null) + if (_ambientLight != null && _ambientLightOrigIntensity != null) { for (int i = 0; i < _ambientLight.Length; i++) { @@ -221,11 +221,14 @@ public void Update() { if (_shockLayer != null) _shockLayer.enabled = false; - if (_ambientLight != null) + if (_ambientLight != null && _ambientLightOrigIntensity != null) { for (int i = 0; i < _ambientLight.Length; i++) { - _ambientLight[i].intensity = _ambientLightOrigIntensity[i]; + if (_ambientLight[i] != null) + { + _ambientLight[i].intensity = _ambientLightOrigIntensity[i]; + } } } diff --git a/NewHorizons/Handlers/PlanetDestructionHandler.cs b/NewHorizons/Handlers/PlanetDestructionHandler.cs index ca8618276..c9fffdf5e 100644 --- a/NewHorizons/Handlers/PlanetDestructionHandler.cs +++ b/NewHorizons/Handlers/PlanetDestructionHandler.cs @@ -1,12 +1,12 @@ +using NewHorizons.Components; using NewHorizons.Components.Stars; using NewHorizons.Utility; -using NewHorizons.Utility.OWML; using NewHorizons.Utility.OuterWilds; +using NewHorizons.Utility.OWML; using System; using System.Collections.Generic; using System.Linq; using UnityEngine; -using NewHorizons.Components; namespace NewHorizons.Handlers { @@ -40,7 +40,14 @@ public static void RemoveStockPlanets() { foreach (var gameObject in toDisable) { - gameObject.SetActive(false); + // Somehow SetActive can NRE + // Seems to only happen if they don't have the DLC installed + // Even with the null check it's complaining so I don't understand at all + try + { + gameObject?.SetActive(false); + } + catch { } } // Kill all non nh proxies foreach (var proxy in GameObject.FindObjectsOfType()) @@ -55,10 +62,14 @@ public static void RemoveStockPlanets() if (Main.Instance.CurrentStarSystem != "EyeOfTheUniverse") { // Since we didn't call RemoveBody on the all planets there are some we have to call here - StrangerRemoved(); TimberHearthRemoved(); GiantsDeepRemoved(); SunRemoved(); + + if (Main.HasDLC) + { + StrangerRemoved(); + } } }, 2); // Have to wait or shit goes wild diff --git a/NewHorizons/Main.cs b/NewHorizons/Main.cs index 96f13fb39..e996ce2bc 100644 --- a/NewHorizons/Main.cs +++ b/NewHorizons/Main.cs @@ -350,9 +350,12 @@ private void OnSceneLoaded(Scene scene, LoadSceneMode mode) GravityCannonBuilder.InitPrefab(); ShuttleBuilder.InitPrefab(); - ProjectionBuilder.InitPrefabs(); - CloakBuilder.InitPrefab(); - RaftBuilder.InitPrefab(); + if (HasDLC) + { + ProjectionBuilder.InitPrefabs(); + CloakBuilder.InitPrefab(); + RaftBuilder.InitPrefab(); + } WarpPadBuilder.InitPrefabs(); } diff --git a/NewHorizons/manifest.json b/NewHorizons/manifest.json index cfc9f760d..1f0f69198 100644 --- a/NewHorizons/manifest.json +++ b/NewHorizons/manifest.json @@ -4,7 +4,7 @@ "author": "xen, Bwc9876, clay, MegaPiggy, John, Trifid, Hawkbar, Book", "name": "New Horizons", "uniqueName": "xen.NewHorizons", - "version": "1.17.1", + "version": "1.17.2", "owmlVersion": "2.9.8", "dependencies": [ "JohnCorby.VanillaFix", "_nebula.MenuFramework", "xen.CommonCameraUtility", "dgarro.CustomShipLogModes" ], "conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_CommonResources" ],