Fixed crashing if LightManager.UpdateObstructVision is called before ViewTarget has been set. Closes #466
This commit is contained in:
@@ -238,6 +238,7 @@ namespace Barotrauma.Lights
|
|||||||
public void UpdateObstructVision(GraphicsDevice graphics, SpriteBatch spriteBatch, Camera cam, Vector2 lookAtPosition)
|
public void UpdateObstructVision(GraphicsDevice graphics, SpriteBatch spriteBatch, Camera cam, Vector2 lookAtPosition)
|
||||||
{
|
{
|
||||||
if (!LosEnabled && !ObstructVision) return;
|
if (!LosEnabled && !ObstructVision) return;
|
||||||
|
if (ViewTarget == null) return;
|
||||||
|
|
||||||
graphics.SetRenderTarget(losTexture);
|
graphics.SetRenderTarget(losTexture);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user