mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-26 02:02:20 +02:00
Not calling leaveField before switchOut
This commit is contained in:
parent
c39177d13e
commit
67bbfcb37d
@ -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
|
* @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
|
* `BATON_PASS` or `SHED_TAIL`, this Pokemon's effects are not cleared upon leaving
|
||||||
* the field.
|
* the field.
|
||||||
*/
|
*/
|
||||||
switchOut(switchType: SwitchType = SwitchType.SWITCH): Promise<void> {
|
switchOut(switchType: SwitchType = SwitchType.SWITCH): Promise<void> {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
this.leaveField(switchType === SwitchType.SWITCH);
|
|
||||||
|
|
||||||
globalScene.ui.setMode(Mode.PARTY, PartyUiMode.FAINT_SWITCH, this.getFieldIndex(), (slotIndex: number, option: PartyOption) => {
|
globalScene.ui.setMode(Mode.PARTY, PartyUiMode.FAINT_SWITCH, this.getFieldIndex(), (slotIndex: number, option: PartyOption) => {
|
||||||
if (slotIndex >= globalScene.currentBattle.getBattlerCount() && slotIndex < 6) {
|
if (slotIndex >= globalScene.currentBattle.getBattlerCount() && slotIndex < 6) {
|
||||||
globalScene.prependToPhase(new SwitchSummonPhase(switchType, this.getFieldIndex(), slotIndex, false), MoveEndPhase);
|
globalScene.prependToPhase(new SwitchSummonPhase(switchType, this.getFieldIndex(), slotIndex, false), MoveEndPhase);
|
||||||
|
Loading…
Reference in New Issue
Block a user