From 89e2642d91e419d2ec61574f98d1e9286f213ce9 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Wed, 1 May 2024 18:24:21 -0400 Subject: [PATCH] Fix update issue for battle stats display --- src/ui/battle-info.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/ui/battle-info.ts b/src/ui/battle-info.ts index ae8f518e727..2ca0457c801 100644 --- a/src/ui/battle-info.ts +++ b/src/ui/battle-info.ts @@ -498,11 +498,14 @@ export default class BattleInfo extends Phaser.GameObjects.Container { this.lastLevel = pokemon.level; } - if (pokemon.summonData) { - const battleStats = pokemon.summonData.battleStats.join(''); - - if (this.lastBattleStats !== battleStats) - this.updateBattleStats(pokemon.summonData.battleStats); + const battleStats = pokemon.summonData + ? pokemon.summonData.battleStats + : battleStatOrder.map(() => 0); + const battleStatsStr = battleStats.join(''); + + if (this.lastBattleStats !== battleStatsStr) { + this.updateBattleStats(battleStats); + this.lastBattleStats = battleStatsStr; } this.shinyIcon.setVisible(pokemon.isShiny());