Fixed Exception when ReadyPlayers < MinTraitors

This commit is contained in:
Exp
2020-08-20 22:16:34 +02:00
parent 82c4c3eb4a
commit daf17e1c64

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.");
}