]> git.sesse.net Git - ultimatescore/commitdiff
Fix an issue (I have no idea why this was not a problem before, sort randomization...
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 29 Sep 2021 20:02:46 +0000 (22:02 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 29 Sep 2021 20:05:36 +0000 (22:05 +0200)
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;
                                        }
                                }