minj / foxtrick

FoxTrick is a browser extension for the Hattrick online football manager game, currently available for Firefox, Google Chrome, as well as for Opera.
https://www.foxtrick.org
GNU General Public License v3.0
69 stars 48 forks source link

Fix U21 matches not being recognised for xp calc #1730

Open unnecessarydave opened 4 months ago

unnecessarydave commented 4 months ago

The updated code in function getGameType wasn't catching U21 continental cup matches. Adding the relevant icon names to the CONT_CUPS list fixes this.

cpf-fin commented 4 months ago

Similar tests are "reversed", does gameIcon.includes(CONT_CUPS) work? (no need to change CONT_CUPS)

unnecessarydave commented 4 months ago

Similar tests are "reversed", does gameIcon.includes(CONT_CUPS) work? (no need to change CONT_CUPS)

Sure, we could do it that way.

gameIcon.includes(CONT_CUPS) alone doesn't work, as I think .includes() takes a search string, not an array. But, we could loop through the array, which I admit is better.

I'll see if I can figure out how update the PR.