From db580a673540564f312756c01e129ef0bf5252d2 Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Sun, 1 Jun 2025 21:24:16 +0200 Subject: [PATCH] Update modifier bar is now called in the apply of consumable held items --- src/items/held-item.ts | 4 +++- src/phases/stat-stage-change-phase.ts | 6 +----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/items/held-item.ts b/src/items/held-item.ts index 0182479727a..db0aa70ce20 100644 --- a/src/items/held-item.ts +++ b/src/items/held-item.ts @@ -113,11 +113,13 @@ export class ConsumableHeldItem extends HeldItem { return true; } - apply(pokemon: Pokemon): boolean { + apply(pokemon: Pokemon, isPlayer: boolean): boolean { const consumed = this.applyConsumable(pokemon); if (consumed) { pokemon.heldItemManager.remove(this.type, 1); + // TODO: Turn this into updateItemBar or something + globalScene.updateModifiers(isPlayer); return true; } diff --git a/src/phases/stat-stage-change-phase.ts b/src/phases/stat-stage-change-phase.ts index 1b63e5af7db..77ed54979db 100644 --- a/src/phases/stat-stage-change-phase.ts +++ b/src/phases/stat-stage-change-phase.ts @@ -239,11 +239,7 @@ export class StatStageChangePhase extends PokemonPhase { ); if (!(existingPhase instanceof StatStageChangePhase)) { // Apply White Herb if needed - const whiteHerb = applyResetNegativeStatStageHeldItem(pokemon); - // If the White Herb was applied, update scene modifiers - if (whiteHerb) { - globalScene.updateModifiers(this.player); - } + applyResetNegativeStatStageHeldItem(pokemon); } pokemon.updateInfo();