]> git.sesse.net Git - ultimatescore/blobdiff - update_sheets.js
Fix an issue (I have no idea why this was not a problem before, sort randomization...
[ultimatescore] / update_sheets.js
index b6e842648bfd083a73e0323f695fc79e4d5ef9e5..ae8df0e3aa0fb8fc8a56e7ba5c8706f36d31c75c 100644 (file)
@@ -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;
                                        }
                                }