diff --git a/NewHorizons/Builder/Atmosphere/FogBuilder.cs b/NewHorizons/Builder/Atmosphere/FogBuilder.cs index 9f1d7da8..f47e3e29 100644 --- a/NewHorizons/Builder/Atmosphere/FogBuilder.cs +++ b/NewHorizons/Builder/Atmosphere/FogBuilder.cs @@ -1,10 +1,10 @@ using NewHorizons.External.Modules; -using NewHorizons.External.Modules.Props; using NewHorizons.Utility; using NewHorizons.Utility.Files; using OWML.Common; using System; using UnityEngine; + namespace NewHorizons.Builder.Atmosphere { public static class FogBuilder @@ -26,7 +26,9 @@ namespace NewHorizons.Builder.Atmosphere internal static void InitPrefabs() { - if (_ramp == null) _ramp = ImageUtilities.GetTexture(Main.Instance, "Assets/textures/FogColorRamp.png"); + // Checking null here it was getting destroyed and wouldnt reload and never worked outside of the first loop + // GetTexture caches itself anyway so it doesn't matter that this gets called multiple times + _ramp = ImageUtilities.GetTexture(Main.Instance, "Assets/textures/FogColorRamp.png"); if (_isInit) return; @@ -73,6 +75,7 @@ namespace NewHorizons.Builder.Atmosphere atmo.fogRampPath != null ? ImageUtilities.GetTexture(mod, atmo.fogRampPath) : atmo.fogTint != null ? ImageUtilities.TintImage(_ramp, atmo.fogTint.ToColor()) : _ramp; + PFC.fogColorRampTexture = colorRampTexture; PFC.fogColorRampIntensity = 1f; if (atmo.fogTint != null)