fix: use fixed point scale for tour scoring

1st=10, 2nd=8, 3rd=6, 4th=4, 5th=3, 6th=2, 7th=1, rest=0.
Ties get same points, next rank skips (1,1,3 pattern).
This commit is contained in:
Samuel Enocsson
2026-03-20 07:37:51 +01:00
parent bdb8bca526
commit d7f7bed8c6
+2 -2
View File
@@ -39,7 +39,7 @@ async function calculateLeaderboard(tourId) {
};
}
const numPlayers = players.length;
const pointsByRank = [10, 8, 6, 4, 3, 2, 1];
for (const course of courses) {
const courseResults = resultsByCourse[course.tour_course_id] || [];
@@ -51,7 +51,7 @@ async function calculateLeaderboard(tourId) {
rank = i + 1;
}
const points = Math.max(numPlayers - rank + 1, 1);
const points = rank <= pointsByRank.length ? pointsByRank[rank - 1] : 0;
const r = courseResults[i];
const relativePar = r.total_strokes - course.par;