Fix Baton Pass not working
parent
f99afa228f
commit
728512cf7d
|
@ -1418,7 +1418,7 @@ export default class BattleScene extends SceneBase {
|
|||
|
||||
playBgm(bgmName?: string, fadeOut?: boolean): void {
|
||||
if (bgmName === undefined)
|
||||
bgmName = this.currentBattle.getBgmOverride(this) || this.arena.bgm;
|
||||
bgmName = this.currentBattle?.getBgmOverride(this) || this.arena?.bgm;
|
||||
if (this.bgm && bgmName === this.bgm.key) {
|
||||
if (!this.bgm.isPlaying) {
|
||||
this.bgm.play({
|
||||
|
|
|
@ -2836,10 +2836,8 @@ export class ForceSwitchOutAttr extends MoveEffectAttr {
|
|||
if (switchOutTarget.hp) {
|
||||
applyPreSwitchOutAbAttrs(PreSwitchOutAbAttr, switchOutTarget);
|
||||
(switchOutTarget as PlayerPokemon).switchOut(this.batonPass, true).then(() => resolve(true));
|
||||
}
|
||||
else {
|
||||
} else
|
||||
resolve(false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if (user.scene.currentBattle.battleType) {
|
||||
|
|
|
@ -2316,6 +2316,7 @@ export class PlayerPokemon extends Pokemon {
|
|||
switchOut(batonPass: boolean, removeFromField: boolean = false): Promise<void> {
|
||||
return new Promise(resolve => {
|
||||
this.resetTurnData();
|
||||
if (!batonPass)
|
||||
this.resetSummonData();
|
||||
this.hideInfo();
|
||||
this.setVisible(false);
|
||||
|
|
Loading…
Reference in New Issue