diff --git a/src/data/berry.ts b/src/data/berry.ts index 96b50caa9..d9daab425 100644 --- a/src/data/berry.ts +++ b/src/data/berry.ts @@ -149,9 +149,11 @@ export function getBerryEffectFunc(berryType: BerryType): BerryEffectFunc { return (pokemon: Pokemon) => { if (pokemon.battleData) pokemon.battleData.berriesEaten.push(berryType); - const ppRestoreMove = pokemon.getMoveset().find(m => !m.getPpRatio()); - ppRestoreMove.ppUsed = Math.max(ppRestoreMove.ppUsed - 10, 0); - pokemon.scene.queueMessage(getPokemonMessage(pokemon, ` restored PP to its move ${ppRestoreMove.getName()}\nusing its ${getBerryName(berryType)}!`)); + const ppRestoreMove = pokemon.getMoveset().find(m => !m.getPpRatio()) ? pokemon.getMoveset().find(m => !m.getPpRatio()) : pokemon.getMoveset().find(m => m.getPpRatio() < 1); + if(ppRestoreMove !== undefined){ + ppRestoreMove.ppUsed = Math.max(ppRestoreMove.ppUsed - 10, 0); + pokemon.scene.queueMessage(getPokemonMessage(pokemon, ` restored PP to its move ${ppRestoreMove.getName()}\nusing its ${getBerryName(berryType)}!`)); + } }; } } \ No newline at end of file