From ad88939dbb33384829cf823838bef9d3c62cb70a Mon Sep 17 00:00:00 2001 From: Misa Date: Sun, 22 Aug 2021 15:54:45 -0700 Subject: [PATCH] Fix regression with niceplay() moving back and forth between zones 2.3 has a regression where if you move back and forth between a zone, you can get the wrong music playing in a zone. An example is the Overworld and Lab. Just walk in to the Lab and immediately walk back out, and you'll get Potential for Anything playing in the Overworld. This regression was caused by facb079b3597b380f876537523cd351a0e637b62. That commit removed assigning -1 to currentsong when a fadeout was called. Basically, the previous behavior was: currentsong is 4, we enter Lab and nicechange gets queued to 3 but currentsong gets set to -1, then going back nicechange gets queued to 4 again. However, if we don't assign -1, then going back will keep nicechange at 3. Why? Because niceplay() checks for currentsong before assigning nicechange. If currentsong is still the same then it doesn't assign nicechange. To fix this, just always unconditionally assign nicechange. --- desktop_version/src/Music.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop_version/src/Music.cpp b/desktop_version/src/Music.cpp index 28f4c60f..438164f8 100644 --- a/desktop_version/src/Music.cpp +++ b/desktop_version/src/Music.cpp @@ -414,8 +414,8 @@ void musicclass::niceplay(int t) fadeout(false); } nicefade = true; - nicechange = t; } + nicechange = t; } void musicclass::changemusicarea(int x, int y)