Fixed characters not appearing in the round summary in mp, minor CrewManager refactoring

This commit is contained in:
Joonas Rikkonen
2017-11-20 20:21:18 +02:00
parent 765587efd7
commit fce7d43ef3
13 changed files with 89 additions and 57 deletions
@@ -148,7 +148,7 @@ namespace Barotrauma
frame.RemoveChild(child);
}
List<Character> aliveCharacters = crewManager.characters.FindAll(c => !c.IsDead && c.AIController is HumanAIController);
List<Character> aliveCharacters = crewManager.GetCharacters().FindAll(c => !c.IsDead && c.AIController is HumanAIController);
characterFrameBottom = 0;
@@ -192,9 +192,9 @@ namespace Barotrauma
if (controlled == this) controlled = null;
if (GameMain.GameSession?.CrewManager != null &&
GameMain.GameSession.CrewManager.characters.Contains(this))
GameMain.GameSession.CrewManager.GetCharacters().Contains(this))
{
GameMain.GameSession.CrewManager.characters.Remove(this);
GameMain.GameSession.CrewManager.RemoveCharacter(this);
}
if (GameMain.Client != null && GameMain.Client.Character == this) GameMain.Client.Character = null;
@@ -291,7 +291,7 @@ namespace Barotrauma
if (configPath == Character.HumanConfigFile)
{
GameMain.GameSession.CrewManager.characters.Add(character);
GameMain.GameSession.CrewManager.AddCharacter(character);
}
}