Bunch of fixes to null reference exceptions caused by removing characters mid-round

This commit is contained in:
Joonas Rikkonen
2017-06-21 16:56:35 +03:00
parent 4ac9aa09c6
commit 38f92acf8e
4 changed files with 28 additions and 8 deletions
+6 -1
View File
@@ -11,7 +11,11 @@ namespace Barotrauma
public static List<AITarget> List = new List<AITarget>();
public readonly Entity Entity;
public Entity Entity
{
get;
private set;
}
private float soundRange;
private float sightRange;
@@ -47,6 +51,7 @@ namespace Barotrauma
public void Remove()
{
List.Remove(this);
Entity = null;
}
public void Draw(SpriteBatch spriteBatch)