From: Steinar H. Gunderson Date: Wed, 29 Sep 2021 20:02:46 +0000 (+0200) Subject: Fix an issue (I have no idea why this was not a problem before, sort randomization... X-Git-Url: https://git.sesse.net/?p=ultimatescore;a=commitdiff_plain;h=a74ae9039824cd10e4c4dbe9c72805bdc138e39e Fix an issue (I have no idea why this was not a problem before, sort randomization?) where all-empty data would claim to have computed thirds. --- diff --git a/update_sheets.js b/update_sheets.js index b6e8426..ae8df0e 100644 --- a/update_sheets.js +++ b/update_sheets.js @@ -248,7 +248,9 @@ function montecarlo(all_teams, groups, games, groups_to_calc) { third_groups = ranked; } else { for (let i = 0; i < groups_to_calc.length; ++i) { - if (third_groups[i].group_idx !== ranked[i].group_idx) { + if (third_groups[i].group_idx !== ranked[i].group_idx || // Different from a previous simulation. + (i < (third_groups.length - 1) && ranked[i].rank === ranked[i + 1].rank) || // Disallow ties. + (i > 0 && ranked[i].rank === ranked[i - 1].rank)) { // Disallow ties. third_groups[i].group_idx = null; } }