1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-23 10:09:43 +01:00

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.
This commit is contained in:
Misa 2020-06-17 00:56:07 -07:00 committed by Ethan Lee
parent 44bd4ec0b7
commit fc265e3c75

View file

@ -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()