Fixed oddities in traitor ratio/assignment logic. The TraitorUseRatio setting is used to determine the number of traitors, the minimum number of traitors is 1 instead of 2, the host is taken into account when determining the number of traitors. Closes #477

This commit is contained in:
Joonas Rikkonen
2018-07-16 11:05:10 +03:00
parent 015eacbcb0
commit ceae0bf94e
2 changed files with 7 additions and 7 deletions
@@ -108,10 +108,9 @@ namespace Barotrauma
codeWords = ToolBox.GetRandomLine(wordsTxt) + ", " + ToolBox.GetRandomLine(wordsTxt);
codeResponse = ToolBox.GetRandomLine(wordsTxt) + ", " + ToolBox.GetRandomLine(wordsTxt);
while (traitorCount-- >= 0)
while (traitorCount-- > 0)
{
if (traitorCandidates.Count <= 0)
break;
if (traitorCandidates.Count <= 0) break;
int traitorIndex = Rand.Int(traitorCandidates.Count);
Character traitorCharacter = traitorCandidates[traitorIndex];