Fix update issue for battle stats display

This commit is contained in:
Flashfyre 2024-05-01 18:24:21 -04:00
parent 7a418109c3
commit 89e2642d91
1 changed files with 8 additions and 5 deletions

View File

@ -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());