From 3c93aa6d3685b901c856a2df99c5ab697736d708 Mon Sep 17 00:00:00 2001 From: Mumble Date: Wed, 24 Jul 2024 12:49:17 -0700 Subject: [PATCH] [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 1bdbe2da5a7e29dce17911eb7c1084de44328573. * Test Re-Run --------- Co-authored-by: Frutescens Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> --- src/system/game-stats.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/system/game-stats.ts b/src/system/game-stats.ts index 4c3f40e5d1e..a8b74f29bb7 100644 --- a/src/system/game-stats.ts +++ b/src/system/game-stats.ts @@ -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;