From 8bdab3d3bcdfcd755fd8bac276eb099ed347b04f Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Tue, 26 Mar 2024 16:07:59 -0400 Subject: [PATCH] Fix dividing by 0 when calculating party member scores --- src/field/pokemon.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 4a4497caf..3f1246e30 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -748,7 +748,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { if (types.length > 1) atkScore *= pokemon.getAttackTypeEffectiveness(types[1]); if (enemyTypes.length > 1) - defScore *= (1 / this.getAttackTypeEffectiveness(enemyTypes[1])); + defScore *= (1 / Math.max(this.getAttackTypeEffectiveness(enemyTypes[1]), 0.25)); let hpDiffRatio = this.getHpRatio() + (1 - pokemon.getHpRatio()); if (outspeed) hpDiffRatio = Math.min(hpDiffRatio * 1.5, 1);