From 6cd9d248a7e94f1f24ffe98134f2527cb73d7150 Mon Sep 17 00:00:00 2001 From: frutescens Date: Sat, 30 Nov 2024 12:31:18 -0800 Subject: [PATCH] Added forgotten conditional. --- src/modifier/modifier.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index 7ab09482f4b..f5f1a1e766b 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -1631,7 +1631,7 @@ export class FlinchChanceModifier extends PokemonHeldItemModifier { */ override apply(pokemon: Pokemon, flinched: BooleanHolder): boolean { // The check for pokemon.battleSummonData is to ensure that a crash doesn't occur when a Pokemon with King's Rock procs a flinch - if (!flinched.value && pokemon.randSeedInt(100) < (this.getStackCount() * this.chance)) { + if (pokemon.battleSummonData && !flinched.value && pokemon.randSeedInt(100) < (this.getStackCount() * this.chance)) { flinched.value = true; return true; } @@ -1639,7 +1639,7 @@ export class FlinchChanceModifier extends PokemonHeldItemModifier { return false; } - getMaxHeldItemCount(pokemon: Pokemon): number { + getMaxHeldItemCount(_pokemon: Pokemon): number { return 3; } }