From fb21caa769423b5171127759e6972fc59bb9849e Mon Sep 17 00:00:00 2001 From: Adam Clemons Date: Fri, 7 Jun 2024 12:17:22 -0600 Subject: [PATCH] [Bug] Fix ability Download switch in (1669) (#1679) * Update ability Dowbload * Remove whitespace * Update ability.ts --- src/data/ability.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index db44835a86a..4b0b380a42f 100755 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -1693,15 +1693,13 @@ export class DownloadAbAttr extends PostSummonAbAttr { this.enemySpDef = 0; this.enemyCountTally = 0; - if (pokemon.getOpponents()[0].summonData !== undefined) { - for (const opponent of pokemon.getOpponents()) { - this.enemyCountTally++; - this.enemyDef += opponent.getBattleStat(Stat.DEF); - this.enemySpDef += opponent.getBattleStat(Stat.SPDEF); - } - this.enemyDef = Math.round(this.enemyDef / this.enemyCountTally); - this.enemySpDef = Math.round(this.enemySpDef / this.enemyCountTally); + for (const opponent of pokemon.getOpponents()) { + this.enemyCountTally++; + this.enemyDef += opponent.getBattleStat(Stat.DEF); + this.enemySpDef += opponent.getBattleStat(Stat.SPDEF); } + this.enemyDef = Math.round(this.enemyDef / this.enemyCountTally); + this.enemySpDef = Math.round(this.enemySpDef / this.enemyCountTally); if (this.enemyDef < this.enemySpDef) { this.stats = [BattleStat.ATK];