Fix bug with releasing first party member

This commit is contained in:
Flashfyre committed 2023-04-13 23:50:48 -04:00
1 parent 1b8c8b5a3f
commit 618128dd00
3 files changed
+27 -3

No files matched your search

+3 -2
View File
@@ -1,4 +1,4 @@
import { CommandPhase } from "../battle-phases";
import { CommandPhase, SummonMissingPhase } from "../battle-phases";
import BattleScene, { Button } from "../battle-scene";
import { PlayerPokemon, PokemonMove } from "../pokemon";
import { addTextObject, TextStyle } from "../text";
@@ -411,7 +411,8 @@ export default class PartyUiHandler extends MessageUiHandler {
this.showText(this.getReleaseMessage(this.scene.getParty()[slotIndex].name), null, () => {
this.clearPartySlots();
this.scene.removePartyMemberModifiers(slotIndex);
this.scene.getParty().splice(slotIndex, 1);
const releasedPokemon = this.scene.getParty().splice(slotIndex, 1)[0];
releasedPokemon.destroy();
this.populatePartySlots();
if (this.cursor >= this.scene.getParty().length)
this.setCursor(this.cursor - 1);