Fix D O G A R S (#1782)

This commit is contained in:
Mr. Sableye
2021-05-11 19:52:54 -07:00
committed by GitHub
parent 5b16702b82
commit 89db00afbd
2 changed files with 6 additions and 1 deletions

View File

@@ -1592,6 +1592,8 @@ class BattleScene {
this.bgm = BattleSound.loadBgm('audio/sm-rival.mp3', 11389, 62158, this.bgm);
break;
}
this.updateBgm();
}
updateBgm() {
/**

View File

@@ -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);