From 3e6d877168994a6ce1f55f1c327d527dbd5a16fa Mon Sep 17 00:00:00 2001 From: shayebeadlingkl Date: Wed, 1 May 2024 14:50:01 -0400 Subject: [PATCH] cleaned up to use getRootSpeciesId() --- src/system/game-data.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/system/game-data.ts b/src/system/game-data.ts index daf01b10458..3c8c859ae67 100644 --- a/src/system/game-data.ts +++ b/src/system/game-data.ts @@ -1080,18 +1080,13 @@ export class GameData { } incrementStarterWinCount(species: PokemonSpecies): void { - const hasPrevolution = pokemonPrevolutions.hasOwnProperty(species.speciesId); + const speciesIdToIncrement: Species = species.getRootSpeciesId(); - if (hasPrevolution) { - this.incrementStarterWinCount(getPokemonSpecies(pokemonPrevolutions[species.speciesId])); - return; + if (!this.starterData[speciesIdToIncrement].winCount) { + this.starterData[speciesIdToIncrement].winCount = 0; } - if (!this.starterData[species.speciesId].winCount) { - this.starterData[species.speciesId].winCount = 0; - } - - this.starterData[species.speciesId].winCount++; + this.starterData[speciesIdToIncrement].winCount++; } addStarterCandy(species: PokemonSpecies, count: integer): void {