Not calling leaveField before switchOut

This commit is contained in:
Wlowscha 2025-02-20 09:20:40 +01:00
parent c39177d13e
commit 67bbfcb37d
No known key found for this signature in database
GPG Key ID: 3C8F1AD330565D04

View File

@ -4437,16 +4437,13 @@ export class PlayerPokemon extends Pokemon {
}
/**
* Causes this mon to leave the field (via {@linkcode leaveField}) and then
* opens the party switcher UI to switch a new mon in
* Opens the party switcher UI to switch a new mon in
* @param switchType the {@linkcode SwitchType} for this switch-out. If this is
* `BATON_PASS` or `SHED_TAIL`, this Pokemon's effects are not cleared upon leaving
* the field.
*/
switchOut(switchType: SwitchType = SwitchType.SWITCH): Promise<void> {
return new Promise(resolve => {
this.leaveField(switchType === SwitchType.SWITCH);
globalScene.ui.setMode(Mode.PARTY, PartyUiMode.FAINT_SWITCH, this.getFieldIndex(), (slotIndex: number, option: PartyOption) => {
if (slotIndex >= globalScene.currentBattle.getBattlerCount() && slotIndex < 6) {
globalScene.prependToPhase(new SwitchSummonPhase(switchType, this.getFieldIndex(), slotIndex, false), MoveEndPhase);