Fix for exceptions when a human is targeting a removed entity while debugdraw is enabled, accessing AITarget position properties after the target has been destroyed doesn't throw an exception (but does log an error in debug builds).
This commit is contained in:
@@ -21,7 +21,7 @@ namespace Barotrauma
|
||||
|
||||
public override void DebugDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)
|
||||
{
|
||||
if (selectedAiTarget != null)
|
||||
if (selectedAiTarget?.Entity != null)
|
||||
{
|
||||
GUI.DrawLine(spriteBatch,
|
||||
new Vector2(Character.DrawPosition.X, -Character.DrawPosition.Y),
|
||||
|
||||
Reference in New Issue
Block a user