From b01826e4f8ad39750aabf4c87eab1fee0616f2c6 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Wed, 11 Jul 2018 10:34:53 +0300 Subject: [PATCH] Fixed crashing if LightManager.UpdateObstructVision is called before ViewTarget has been set. Closes #466 --- Barotrauma/BarotraumaClient/Source/Map/Lights/LightManager.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Barotrauma/BarotraumaClient/Source/Map/Lights/LightManager.cs b/Barotrauma/BarotraumaClient/Source/Map/Lights/LightManager.cs index e17aca912..b8e2f6960 100644 --- a/Barotrauma/BarotraumaClient/Source/Map/Lights/LightManager.cs +++ b/Barotrauma/BarotraumaClient/Source/Map/Lights/LightManager.cs @@ -238,6 +238,7 @@ namespace Barotrauma.Lights public void UpdateObstructVision(GraphicsDevice graphics, SpriteBatch spriteBatch, Camera cam, Vector2 lookAtPosition) { if (!LosEnabled && !ObstructVision) return; + if (ViewTarget == null) return; graphics.SetRenderTarget(losTexture);