Fix max elixir logic not working properly

This commit is contained in:
Flashfyre 2024-01-26 18:36:23 -05:00
parent c5eb86b0b1
commit 9a00090617
1 changed files with 2 additions and 2 deletions

View File

@ -900,7 +900,7 @@ export class PokemonPpRestoreModifier extends ConsumablePokemonMoveModifier {
apply(args: any[]): boolean { apply(args: any[]): boolean {
const pokemon = args[0] as Pokemon; const pokemon = args[0] as Pokemon;
const move = pokemon.getMoveset()[this.moveIndex]; const move = pokemon.getMoveset()[this.moveIndex];
move.ppUsed = this.restorePoints >= -1 ? Math.max(move.ppUsed - this.restorePoints, 0) : 0; move.ppUsed = this.restorePoints > -1 ? Math.max(move.ppUsed - this.restorePoints, 0) : 0;
return true; return true;
} }
@ -918,7 +918,7 @@ export class PokemonAllMovePpRestoreModifier extends ConsumablePokemonModifier {
apply(args: any[]): boolean { apply(args: any[]): boolean {
const pokemon = args[0] as Pokemon; const pokemon = args[0] as Pokemon;
for (let move of pokemon.getMoveset()) for (let move of pokemon.getMoveset())
move.ppUsed = this.restorePoints >= -1 ? Math.max(move.ppUsed - this.restorePoints, 0) : 0; move.ppUsed = this.restorePoints > -1 ? Math.max(move.ppUsed - this.restorePoints, 0) : 0;
return true; return true;
} }