From 9c7868356ca8d01007c1d02c3646d5dbf6ee0d92 Mon Sep 17 00:00:00 2001 From: Jonas Simoen Date: Thu, 25 Jan 2024 18:37:16 +0100 Subject: [PATCH] fix: CS only if played more than 60 mins --- src/utils/PointsCalculator.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/PointsCalculator.ts b/src/utils/PointsCalculator.ts index 7323f2f..83da120 100644 --- a/src/utils/PointsCalculator.ts +++ b/src/utils/PointsCalculator.ts @@ -81,7 +81,7 @@ export const calculatePoints = (playerStat: Statistic, positionId: number): numb // Goals against tempPoints += (Math.floor(playerStat.goalsAgainst / 2) || 0) * PPS.CONCEDED_2[positionId]; // Clean sheet - tempPoints += (playerStat.goalsAgainst || 0 ) === 0 ? PPS.CLEAN_SHEET[positionId] : 0; + tempPoints += (playerStat.minutesPlayed >= 60 && (playerStat.goalsAgainst || 0 ) === 0) ? PPS.CLEAN_SHEET[positionId] : 0; // Passing accuracy above 85% tempPoints += playerStat.totalPasses !== 0 && (playerStat.accuratePasses / playerStat.totalPasses > 0.85) ? PPS.PASS_ACCURACY_MORE_85[positionId] : 0; // Key passes (per 2)