[Bug] Game Stats Sub-Legendary NaN bug for new game files (#3122)

* Bug Fix

* Update src/system/game-stats.ts

Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>

* Fixing a test

* Revert "Fixing a test"

This reverts commit 1bdbe2da5a.

* Test Re-Run

---------

Co-authored-by: Frutescens <info@laptop>
Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>
This commit is contained in:
Mumble 2024-07-24 12:49:17 -07:00 committed by GitHub
parent f3a98efd39
commit 3c93aa6d36
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -58,9 +58,9 @@ export class GameStats {
this.pokemonCaught = source?.pokemonCaught || 0;
this.pokemonHatched = source?.pokemonHatched || 0;
// Currently handled by migration
this.subLegendaryPokemonSeen = source?.subLegendaryPokemonSeen;
this.subLegendaryPokemonCaught = source?.subLegendaryPokemonCaught;
this.subLegendaryPokemonHatched = source?.subLegendaryPokemonHatched;
this.subLegendaryPokemonSeen = source?.subLegendaryPokemonSeen ?? 0;
this.subLegendaryPokemonCaught = source?.subLegendaryPokemonCaught ?? 0;
this.subLegendaryPokemonHatched = source?.subLegendaryPokemonHatched ?? 0;
this.legendaryPokemonSeen = source?.legendaryPokemonSeen || 0;
this.legendaryPokemonCaught = source?.legendaryPokemonCaught || 0;
this.legendaryPokemonHatched = source?.legendaryPokemonHatched || 0;