recursively check for prevolution
parent
4e2f54baa9
commit
ed6e53df3d
|
|
@ -1080,6 +1080,13 @@ export class GameData {
|
|||
}
|
||||
|
||||
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) {
|
||||
this.starterData[species.speciesId].winCount = 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue