mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-25 00:06:18 +00:00
Fix Baton Pass not working
This commit is contained in:
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,7 +2316,8 @@ export class PlayerPokemon extends Pokemon {
|
||||
switchOut(batonPass: boolean, removeFromField: boolean = false): Promise<void> {
|
||||
return new Promise(resolve => {
|
||||
this.resetTurnData();
|
||||
this.resetSummonData();
|
||||
if (!batonPass)
|
||||
this.resetSummonData();
|
||||
this.hideInfo();
|
||||
this.setVisible(false);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user