Combined if statements

This commit is contained in:
TaylorLeLievre 2024-08-25 23:20:14 -04:00
parent 8accf0aee8
commit 06eab54c1c

View File

@ -4053,12 +4053,10 @@ export class PostFaintHPDamageAbAttr extends PostFaintAbAttr {
}
applyPostFaint(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker: Pokemon | undefined, move: Move | undefined, hitResult: HitResult | undefined, args: any[]): boolean {
if (move !== undefined && attacker !== undefined) { //If the mon didn't die to indirect damage
if (!simulated) {
const damage = pokemon.turnData.attacksReceived[0].damage;
attacker.damageAndUpdate((damage), HitResult.OTHER);
attacker.turnData.damageTaken += damage;
}
if (move !== undefined && attacker !== undefined && !simulated) { //If the mon didn't die to indirect damage
const damage = pokemon.turnData.attacksReceived[0].damage;
attacker.damageAndUpdate((damage), HitResult.OTHER);
attacker.turnData.damageTaken += damage;
}
return true;
}