fix issues

This commit is contained in:
2026-01-02 00:21:24 +01:00
parent 79913bb45e
commit 8693dde21e
46 changed files with 1680 additions and 302 deletions

View File

@@ -596,8 +596,12 @@ export class RatingEventFactory {
startPosition: number,
fieldStrength: number
): number {
// Handle edge cases where data might be inconsistent
// If totalDrivers is less than position, use position as totalDrivers for calculation
const effectiveTotalDrivers = Math.max(totalDrivers, position);
// Base score from position (reverse percentile)
const positionScore = ((totalDrivers - position + 1) / totalDrivers) * 100;
const positionScore = ((effectiveTotalDrivers - position + 1) / effectiveTotalDrivers) * 100;
// Bonus for positions gained
const positionsGained = startPosition - position;