Fixed a NullReferenceException caused when you try to play a round with traitors enabled while there are not enough player characters.

This commit is contained in:
Alex Noir
2017-12-05 16:17:51 +03:00
parent 38815c3b69
commit 1e8c1f7f04
@@ -69,7 +69,7 @@ namespace Barotrauma
get { return traitorList; } get { return traitorList; }
} }
private List<Traitor> traitorList; private List<Traitor> traitorList = new List<Traitor>();
public string codeWords, codeResponse; public string codeWords, codeResponse;
@@ -112,7 +112,6 @@ namespace Barotrauma
codeWords = ToolBox.GetRandomLine(wordsTxt) + ", " + ToolBox.GetRandomLine(wordsTxt); codeWords = ToolBox.GetRandomLine(wordsTxt) + ", " + ToolBox.GetRandomLine(wordsTxt);
codeResponse = ToolBox.GetRandomLine(wordsTxt) + ", " + ToolBox.GetRandomLine(wordsTxt); codeResponse = ToolBox.GetRandomLine(wordsTxt) + ", " + ToolBox.GetRandomLine(wordsTxt);
traitorList = new List<Traitor>();
while (TraitorCount-- >= 0) while (TraitorCount-- >= 0)
{ {
if (traitorCandidates.Count <= 0) if (traitorCandidates.Count <= 0)