Merge pull request #1827 from exp111/20200820-min-traitor-exception

Fixed Exception when ReadyPlayers < MinTraitors
This commit is contained in:
Pieter-Jan Briers
2020-08-21 00:08:47 +02:00
committed by GitHub

View File

@@ -91,6 +91,11 @@ namespace Content.Server.GameTicking.GamePresets
IPlayerSession traitor;
if(prefList.Count == 0)
{
if (list.Count == 0)
{
Logger.InfoS("preset", "Insufficient ready players to fill up with traitors, stopping the selection.");
break;
}
traitor = _random.PickAndTake(list);
Logger.InfoS("preset", "Insufficient preferred traitors, picking at random.");
}