From 8e925913da86483f6d639f1d5f4c5e6385d800bd Mon Sep 17 00:00:00 2001 From: Matthew Olker Date: Thu, 9 May 2024 12:50:58 -0400 Subject: [PATCH] account for overriding empty move --- src/field/pokemon.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 94a0fd5c9a9..9f3ed3f3058 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -729,7 +729,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { const overrideArray: Array = this.isPlayer() ? Overrides.MOVESET_OVERRIDE : Overrides.OPP_MOVESET_OVERRIDE; if (overrideArray.length > 0) { overrideArray.forEach((move: Moves, index: number) => { - this.moveset[index] = new PokemonMove(move, Math.min(this.moveset[index].ppUsed, allMoves[move].pp)) + const ppUsed = this.moveset[index]?.ppUp || 0; + this.moveset[index] = new PokemonMove(move, Math.min(ppUsed, allMoves[move].pp)) }); }