diff --git a/src/ui/party-ui-handler.ts b/src/ui/party-ui-handler.ts index e7c4069c16e..a61037548e6 100644 --- a/src/ui/party-ui-handler.ts +++ b/src/ui/party-ui-handler.ts @@ -166,6 +166,8 @@ export default class PartyUiHandler extends MessageUiHandler { private iconAnimHandler: PokemonIconAnimHandler; + private blockInput: boolean; + private static FilterAll = (_pokemon: PlayerPokemon) => null; public static FilterNonFainted = (pokemon: PlayerPokemon) => { @@ -317,7 +319,7 @@ export default class PartyUiHandler extends MessageUiHandler { processInput(button: Button): boolean { const ui = this.getUi(); - if (this.pendingPrompt) { + if (this.pendingPrompt || this.blockInput) { return false; } @@ -485,7 +487,9 @@ export default class PartyUiHandler extends MessageUiHandler { this.clearOptions(); ui.playSelect(); if (this.cursor >= this.scene.currentBattle.getBattlerCount() || !pokemon.isAllowedInBattle()) { + this.blockInput = true; this.showText(i18next.t("partyUiHandler:releaseConfirmation", { pokemonName: getPokemonNameWithAffix(pokemon) }), null, () => { + this.blockInput = false; ui.setModeWithoutClear(Mode.CONFIRM, () => { ui.setMode(Mode.PARTY); this.doRelease(this.cursor);