From 58ae93c4ccfb9eae31229066ef6629f3dfd45553 Mon Sep 17 00:00:00 2001 From: Misa Date: Fri, 10 Sep 2021 19:37:33 -0700 Subject: [PATCH] Music: Do not do fades if not playing This fixes a regression where entering playtesting while a track was fading out (by exiting out of playtesting with a track playing and then immediately entering back in with the level start music set) would result in no music. The cause is the game doing fades even though nothing is playing, which puts it in a confusing state. --- desktop_version/src/Music.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/desktop_version/src/Music.cpp b/desktop_version/src/Music.cpp index 361005c8..f5891f89 100644 --- a/desktop_version/src/Music.cpp +++ b/desktop_version/src/Music.cpp @@ -357,6 +357,11 @@ static enum FadeCode processmusicfade(struct FadeState* state, int* volume) void musicclass::fadeMusicVolumeIn(int ms) { + if (halted()) + { + return; + } + m_doFadeInVol = true; m_doFadeOutVol = false; @@ -374,6 +379,11 @@ void musicclass::fadeMusicVolumeIn(int ms) void musicclass::fadeMusicVolumeOut(const int fadeout_ms) { + if (halted()) + { + return; + } + m_doFadeInVol = false; m_doFadeOutVol = true;