recursively check for prevolution

This commit is contained in:
shayebeadlingkl 2024-05-01 14:36:51 -04:00
parent 4e2f54baa9
commit ed6e53df3d

View File

@ -1080,6 +1080,13 @@ export class GameData {
} }
incrementStarterWinCount(species: PokemonSpecies): void { incrementStarterWinCount(species: PokemonSpecies): void {
const hasPrevolution = pokemonPrevolutions.hasOwnProperty(species.speciesId);
if (hasPrevolution) {
this.incrementStarterWinCount(getPokemonSpecies(pokemonPrevolutions[species.speciesId]));
return;
}
if (!this.starterData[species.speciesId].winCount) { if (!this.starterData[species.speciesId].winCount) {
this.starterData[species.speciesId].winCount = 0; this.starterData[species.speciesId].winCount = 0;
} }