Updated WeightedChooser, players who just sat are chosen last.

This commit is contained in:
Jonathan Bernard 2010-08-23 20:33:24 -05:00
parent a090beb2e6
commit 38c6cb2552

View File

@ -45,6 +45,12 @@ public class WeightedChooser extends PlayerChooser {
} }
protected int getThreshold(def players) { protected int getThreshold(def players) {
return (players.max { it.gamesSat }).gamesSat - hardLimit int highest = (players.max { it.gamesSat }).gamesSat
// everyone has 0 games sat, no threshold
if (highest == 0) return 0;
// if any players have sat at least one game, exclude those that haven't
return Math.max(highest - hardLimit, 1)
} }
} }