From 0bde6f1ecac05107cdd6e8628b7930425263da2b Mon Sep 17 00:00:00 2001 From: Misa Date: Mon, 12 Apr 2021 11:39:55 -0700 Subject: [PATCH] Reset fade booleans when halting music This fixes the 2.2-and-below music blocking workaround not working in 2.3. The issue was that when the music got halted by the script, the fade volume would still be processing, silently being decremented in the background. So the script playing the track afterwards would make the game queue it (as it was called during the fade), but then the music is halted so the game would attempt to play it, but the fade is STILL happening so it wouldn't actually play it and would attempt to queue the track again. However, that queue gets discarded immediately afterwards because the music.play() call happened inside the code responsible for playing the queued music, and that code unconditionally clears the queue variables immediately after calling play(). So that's good to know - if the game queues a song, but fails to play it because of a fade, it's not going to immediately re-queue it and potentially get stuck in a loop of infinitely queueing the same song over and over again each frame. Anyways, the source of the problem is not resetting the fade booleans when halting music, so I've reset them. Fixes #701. --- desktop_version/src/Music.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/desktop_version/src/Music.cpp b/desktop_version/src/Music.cpp index e69453e2..e376b503 100644 --- a/desktop_version/src/Music.cpp +++ b/desktop_version/src/Music.cpp @@ -268,6 +268,8 @@ void musicclass::haltdasmusik(void) /* Just pauses music. This is intended. */ pause(); currentsong = -1; + m_doFadeInVol = false; + m_doFadeOutVol = false; } void musicclass::silencedasmusik(void)