Updated WeightedChooser, players who just sat are chosen last.
This commit is contained in:
parent
a090beb2e6
commit
38c6cb2552
@ -45,6 +45,12 @@ public class WeightedChooser extends PlayerChooser {
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user