diff --git a/Content.Server/_SSS/SuspicionGameRule/SuspicionRuleSystem.Spawning.cs b/Content.Server/_SSS/SuspicionGameRule/SuspicionRuleSystem.Spawning.cs index 6bb2ca4ffa..1b7b3952f4 100644 --- a/Content.Server/_SSS/SuspicionGameRule/SuspicionRuleSystem.Spawning.cs +++ b/Content.Server/_SSS/SuspicionGameRule/SuspicionRuleSystem.Spawning.cs @@ -79,6 +79,16 @@ private void StartRound(EntityUid uid, SuspicionRuleComponent component, GameRul var traitorCount = MathHelper.Clamp((int) (participatingPlayers.Count * component.TraitorPercentage), 1, allPlayerData.Count); var detectiveCount = MathHelper.Clamp((int) (participatingPlayers.Count * component.DetectivePercentage), 1, allPlayerData.Count); + if (traitorCount + detectiveCount > participatingPlayers.Count) + { + // we somehow have more picked players than valid + + // what the fuck + + traitorCount = participatingPlayers.Count; + detectiveCount = 0; + } + RobustRandom.Shuffle(participatingPlayers); // Shuffle the list so we can just take the first N players RobustRandom.Shuffle(participatingPlayers); RobustRandom.Shuffle(participatingPlayers); // I don't trust the shuffle.