From a6d115342c5b5cd60baf16b2766557ecec8a2174 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Sat, 15 Mar 2025 19:33:18 +0100 Subject: [PATCH] fix: amb el audio muted, al acabar la partida el fade per al roido de boles el tornava a deixar activat --- source/game.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/source/game.cpp b/source/game.cpp index 3ead1e2..afedf2d 100644 --- a/source/game.cpp +++ b/source/game.cpp @@ -328,8 +328,11 @@ void Game::updateGameStateGameOver() if (fade_out_->isEnabled()) { - const float vol = static_cast(64 * (100 - fade_out_->getValue())) / 100.0f; - JA_SetSoundVolume(to_JA_volume(static_cast(vol))); + if (options.audio.enabled) + { + const float vol = static_cast(64 * (100 - fade_out_->getValue())) / 100.0f; + JA_SetSoundVolume(to_JA_volume(static_cast(vol))); + } } if (fade_out_->hasEnded()) @@ -344,8 +347,11 @@ void Game::updateGameStateGameOver() // La partida ha terminado con la derrota de los jugadores section::name = section::Name::HI_SCORE_TABLE; } - JA_StopChannel(-1); - JA_SetSoundVolume(to_JA_volume(options.audio.sound.volume)); + if (options.audio.enabled) + { + JA_StopChannel(-1); + JA_SetSoundVolume(to_JA_volume(options.audio.sound.volume)); + } } }