diff --git a/src/data/ability.ts b/src/data/ability.ts index 49e1836502a..3ea83a925db 100755 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -4711,7 +4711,7 @@ export function applyPostBattleAbAttrs(attrType: Constructor, } export function applyPostFaintAbAttrs(attrType: Constructor, - pokemon: Pokemon, attacker: Pokemon | undefined, move: Move | undefined, hitResult: HitResult | undefined, simulated: boolean = false, ...args: any[]): Promise { + pokemon: Pokemon, attacker?: Pokemon, move?: Move, hitResult?: HitResult, simulated: boolean = false, ...args: any[]): Promise { return applyAbAttrsInternal(attrType, pokemon, (attr, passive) => attr.applyPostFaint(pokemon, passive, simulated, attacker, move, hitResult, args), args, false, simulated); } diff --git a/src/phases/faint-phase.ts b/src/phases/faint-phase.ts index 8d4890a3adb..c30003b79aa 100644 --- a/src/phases/faint-phase.ts +++ b/src/phases/faint-phase.ts @@ -66,7 +66,7 @@ export class FaintPhase extends PokemonPhase { const lastAttack = pokemon.turnData.attacksReceived[0]; applyPostFaintAbAttrs(PostFaintAbAttr, pokemon, this.scene.getPokemonById(lastAttack.sourceId)!, new PokemonMove(lastAttack.move).getMove(), lastAttack.result); // TODO: is this bang correct? } else { //If killed by indirect damage, apply post-faint abilities without providing a last move - applyPostFaintAbAttrs(PostFaintAbAttr, pokemon, undefined, undefined, undefined); + applyPostFaintAbAttrs(PostFaintAbAttr, pokemon); } const alivePlayField = this.scene.getField(true);