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 {
|
playBgm(bgmName?: string, fadeOut?: boolean): void {
|
||||||
if (bgmName === undefined)
|
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 && bgmName === this.bgm.key) {
|
||||||
if (!this.bgm.isPlaying) {
|
if (!this.bgm.isPlaying) {
|
||||||
this.bgm.play({
|
this.bgm.play({
|
||||||
|
|
|
@ -2836,10 +2836,8 @@ export class ForceSwitchOutAttr extends MoveEffectAttr {
|
||||||
if (switchOutTarget.hp) {
|
if (switchOutTarget.hp) {
|
||||||
applyPreSwitchOutAbAttrs(PreSwitchOutAbAttr, switchOutTarget);
|
applyPreSwitchOutAbAttrs(PreSwitchOutAbAttr, switchOutTarget);
|
||||||
(switchOutTarget as PlayerPokemon).switchOut(this.batonPass, true).then(() => resolve(true));
|
(switchOutTarget as PlayerPokemon).switchOut(this.batonPass, true).then(() => resolve(true));
|
||||||
}
|
} else
|
||||||
else {
|
|
||||||
resolve(false);
|
resolve(false);
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (user.scene.currentBattle.battleType) {
|
else if (user.scene.currentBattle.battleType) {
|
||||||
|
|
|
@ -2316,6 +2316,7 @@ export class PlayerPokemon extends Pokemon {
|
||||||
switchOut(batonPass: boolean, removeFromField: boolean = false): Promise<void> {
|
switchOut(batonPass: boolean, removeFromField: boolean = false): Promise<void> {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
this.resetTurnData();
|
this.resetTurnData();
|
||||||
|
if (!batonPass)
|
||||||
this.resetSummonData();
|
this.resetSummonData();
|
||||||
this.hideInfo();
|
this.hideInfo();
|
||||||
this.setVisible(false);
|
this.setVisible(false);
|
||||||
|
|
Loading…
Reference in New Issue