Fixed crashing if LightManager.UpdateObstructVision is called before ViewTarget has been set. Closes #466

This commit is contained in:
Joonas Rikkonen
2018-07-11 10:34:53 +03:00
parent 846291ff54
commit b01826e4f8

View File

@@ -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);