From fc265e3c758ccac1b93bbf8e616463c6efd492ae Mon Sep 17 00:00:00 2001 From: Misa Date: Wed, 17 Jun 2020 00:56:07 -0700 Subject: [PATCH] Fix unmounting assets exiting to menu resulting in silence If you exited to the menu normally (i.e. got on a code path that went through Game::quittomenu()), the menu music wouldn't play. This is because FILESYSTEM_unmountassets() was put after music.play(6). So the game would play the custom level's track 6, and then unmount it, which meant it could no longer play track 6, but there's nothing telling the game to play track 6 again. So I just changed the frame ordering around. I also added a comment to make sure anyone reading the code is aware of the frame order dependency. --- desktop_version/src/Game.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index 94c3d072..2c2c7d4d 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -7631,6 +7631,7 @@ void Game::quittomenu() { gamestate = TITLEMODE; graphics.fademode = 4; + FILESYSTEM_unmountassets(); // should be before music.play(6) music.play(6); graphics.backgrounddrawn = false; map.tdrawback = true; @@ -7669,7 +7670,6 @@ void Game::quittomenu() createmenu(Menu::mainmenu); } script.hardreset(); - FILESYSTEM_unmountassets(); } void Game::returntolab()