From 03f72aae964dffadd64c23639ebe2ce5a85d13f9 Mon Sep 17 00:00:00 2001 From: HoeenHero Date: Sat, 7 Mar 2020 21:29:31 -0500 Subject: [PATCH] Fix Miror B Easter Egg Themes (#1472) The themes would not play because we were tracking what theme to set to with BattleSound.bgmNum. When loading a new bgm, BattleSound.setBgm will simply return if the existing bgm (BattleSound.bgm) is the same as the one were trying to set the bgm to. --- src/battle-animations.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/battle-animations.ts b/src/battle-animations.ts index 9d24e3202..251257001 100644 --- a/src/battle-animations.ts +++ b/src/battle-animations.ts @@ -712,6 +712,7 @@ class BattleScene { } } teamPreview() { + let newBGNum = 0; for (let siden = 0; siden < 2; siden++) { let side = this.battle.sides[siden]; let textBuf = ''; @@ -766,14 +767,16 @@ class BattleScene { } this.$sprites[siden].html(buf + buf2); - if (ludicoloCount >= 2) { - this.bgmNum = -3; - } else if (ludicoloCount + lombreCount >= 2) { - this.bgmNum = -2; + if (!newBGNum) { + if (ludicoloCount >= 2) { + newBGNum = -3; + } else if (ludicoloCount + lombreCount >= 2) { + newBGNum = -2; + } } } - if (this.bgmNum < 0) { - this.setBgm(this.bgmNum); + if (newBGNum !== 0) { + this.setBgm(newBGNum); } this.wait(1000); this.updateSidebars();