From 88cb6083ebe4e3164a5318f1e46bc8705168a4c9 Mon Sep 17 00:00:00 2001 From: dexy Date: Wed, 26 Feb 2020 00:01:45 +1100 Subject: [PATCH] Possibly improved resilience of UpdateGlobalLights --- CodeWalker/Rendering/Renderer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CodeWalker/Rendering/Renderer.cs b/CodeWalker/Rendering/Renderer.cs index a04ef83..30cb1b4 100644 --- a/CodeWalker/Rendering/Renderer.cs +++ b/CodeWalker/Rendering/Renderer.cs @@ -468,7 +468,7 @@ namespace CodeWalker.Rendering Color4 lightnaturaldowncolour = new Color4(0.0f); Color4 lightartificialupcolour = new Color4(0.0f); Color4 lightartificialdowncolour = new Color4(0.0f); - bool hdr = shaders.hdr; + bool hdr = (shaders != null) ? shaders.hdr : false; float hdrint = 1.0f; Vector3 sundir = Vector3.Up; Vector3 moondir = Vector3.Down; @@ -535,7 +535,7 @@ namespace CodeWalker.Rendering //lightdir = Vector3.Normalize(weather.CurrentValues.sunDirection); - if (weather != null && weather.Inited) + if ((weather != null) && weather.Inited) { lightdircolour = (Color4)weather.CurrentValues.lightDirCol; lightdirambcolour = (Color4)weather.CurrentValues.lightDirAmbCol;