increment works properly

This commit is contained in:
shayebeadlingkl 2024-05-01 12:35:45 -04:00
parent f2098c8e9e
commit 4e2f54baa9

View File

@ -1079,15 +1079,12 @@ export class GameData {
}); });
} }
incrementStarterWinCount(species: PokemonSpecies):void { incrementStarterWinCount(species: PokemonSpecies): void {
const speciesWinCount = this.starterData[species.speciesId].winCount; if (!this.starterData[species.speciesId].winCount) {
if(Number.isNaN(speciesWinCount)) {
this.starterData[species.speciesId].winCount = 0; this.starterData[species.speciesId].winCount = 0;
} }
this.starterData[species.speciesId].winCount++; this.starterData[species.speciesId].winCount++;
console.log(this.starterData[species.speciesId].winCount);
} }
addStarterCandy(species: PokemonSpecies, count: integer): void { addStarterCandy(species: PokemonSpecies, count: integer): void {