Fix PostDefendAbilitySwapAbAttr

This commit is contained in:
Dean 2025-01-17 23:59:09 -08:00
parent 2a971e73ab
commit 34d2919586

View File

@ -1056,9 +1056,9 @@ export class PostDefendAbilitySwapAbAttr extends PostDefendAbAttr {
if (move.checkFlag(MoveFlags.MAKES_CONTACT, attacker, pokemon)
&& !attacker.getAbility().hasAttr(UnswappableAbilityAbAttr) && !move.hitsSubstitute(attacker, pokemon)) {
if (!simulated) {
const tempAbilityId = attacker.getAbility().id;
attacker.summonData.ability = pokemon.getAbility().id;
pokemon.summonData.ability = tempAbilityId;
const tempAbility = attacker.getAbility();
attacker.setTempAbility(pokemon.getAbility());
pokemon.setTempAbility(tempAbility);
}
return true;
}