From d505fca845e31d70c4ef01a45248b96df1b233e7 Mon Sep 17 00:00:00 2001 From: unnecessarydave <161469690+unnecessarydave@users.noreply.github.com> Date: Mon, 25 Mar 2024 14:48:24 +0000 Subject: [PATCH] fix U21 matches not being recognised for xp calc The updated code in function getNTType() wasn't catching U21 continental cup matches. --- .../player-stats-experience.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/content/information-aggregation/player-stats-experience.js b/content/information-aggregation/player-stats-experience.js index a66a200f0..b27b824ee 100644 --- a/content/information-aggregation/player-stats-experience.js +++ b/content/information-aggregation/player-stats-experience.js @@ -283,14 +283,16 @@ Foxtrick.modules.PlayerStatsExperience = { 'nt_cup_europe', 'nt_cup_americas', 'nt_cup_africa', - 'nt_cup_asia', + 'nt_cup_asia' ]; - if (CONT_CUPS.includes(gameIcon)) { - // weeks 11-12 are KO - // eslint-disable-next-line no-magic-numbers - return !isFinalSeason && week >= 11 - ? 'matchNtContinentalKO' - : 'matchNtContinental'; + for (var contCupName of CONT_CUPS) { + if (gameIcon.includes(contCupName)) { // also catch u21, which has the addition "_u21" at the end + // weeks 11-12 are KO + // eslint-disable-next-line no-magic-numbers + return !isFinalSeason && week >= 11 + ? 'matchNtContinentalKO' + : 'matchNtContinental'; + } } Foxtrick.log("WARNING: Unmatched gameIcon for NT", gameIcon); // TODO: Can this even happen?