Skip to content

Commit

Permalink
fix U21 matches not being recognised for xp calc
Browse files Browse the repository at this point in the history
The updated code in function getNTType() wasn't catching U21 continental cup
matches.
  • Loading branch information
unnecessarydave committed Mar 25, 2024
1 parent 10158d1 commit d505fca
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions content/information-aggregation/player-stats-experience.js
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down

0 comments on commit d505fca

Please sign in to comment.