diff --git a/src/battle-animations.ts b/src/battle-animations.ts index fb79d3ae2..6b9475e7e 100644 --- a/src/battle-animations.ts +++ b/src/battle-animations.ts @@ -1592,6 +1592,8 @@ class BattleScene { this.bgm = BattleSound.loadBgm('audio/sm-rival.mp3', 11389, 62158, this.bgm); break; } + + this.updateBgm(); } updateBgm() { /** diff --git a/src/battle-sound.ts b/src/battle-sound.ts index 3f316e13e..ae1bac2c2 100644 --- a/src/battle-sound.ts +++ b/src/battle-sound.ts @@ -137,7 +137,10 @@ const BattleSound = new class { /** loopstart and loopend are in milliseconds */ loadBgm(url: string, loopstart: number, loopend: number, replaceBGM?: BattleBGM | null) { - if (replaceBGM) this.deleteBgm(replaceBGM); + if (replaceBGM) { + replaceBGM.stop(); + this.deleteBgm(replaceBGM); + } const bgm = new BattleBGM(url, loopstart, loopend); this.bgm.push(bgm);