From 1e432fc74b958e4629c4b33de85ee103444069ed Mon Sep 17 00:00:00 2001 From: Mumble <171087428+frutescens@users.noreply.github.com> Date: Sun, 1 Sep 2024 21:26:35 -0700 Subject: [PATCH] [Bug] Fixed pre-set volume oversight (#3963) Co-authored-by: frutescens --- src/battle-scene.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 2a920864850..e761d8fca39 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -1791,6 +1791,7 @@ export default class BattleScene extends SceneBase { config = config ?? {}; try { const keyDetails = key.split("/"); + config["volume"] = config["volume"] ?? 1; switch (keyDetails[0]) { case "level_up_fanfare": case "item_fanfare": @@ -1800,11 +1801,11 @@ export default class BattleScene extends SceneBase { case "evolution_fanfare": // These sounds are loaded in as BGM, but played as sound effects // When these sounds are updated in updateVolume(), they are treated as BGM however because they are placed in the BGM Cache through being called by playSoundWithoutBGM() - config["volume"] = this.masterVolume * this.bgmVolume; + config["volume"] *= (this.masterVolume * this.bgmVolume); break; case "battle_anims": case "cry": - config["volume"] = this.masterVolume * this.fieldVolume; + config["volume"] *= (this.masterVolume * this.fieldVolume); //PRSFX sound files are unusually loud if (keyDetails[1].startsWith("PRSFX- ")) { config["volume"] *= 0.5; @@ -1812,10 +1813,10 @@ export default class BattleScene extends SceneBase { break; case "ui": //As of, right now this applies to the "select", "menu_open", "error" sound effects - config["volume"] = this.masterVolume * this.uiVolume; + config["volume"] *= (this.masterVolume * this.uiVolume); break; case "se": - config["volume"] = this.masterVolume * this.seVolume; + config["volume"] *= (this.masterVolume * this.seVolume); break; } this.sound.play(key, config);