mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-10 19:09:45 +01:00
Fix custom assets not being unmounted when exiting from editor/credits
If you exited from the editor, custom assets would not be unmounted. But I made sure to put the FILESYSTEM_unmountassets() before the music.play(6) because otherwise the menu music wouldn't play. You could also exit to the menu from a custom level using the rollcredits() command, so I made sure to put a FILESYSTEM_unmountassets() when returning to the menu from the credits as well. I also made sure to put it before the music.playef(18) so there's no risk of the sound effect not playing properly, or not playing the non-level-specific one. I added a comment to both FILESYSTEM_unmountasset()s to make sure anyone reading the code is aware of the frame order dependency.
This commit is contained in:
parent
f9dfae0144
commit
44bd4ec0b7
2 changed files with 3 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
#include "Logic.h"
|
#include "Logic.h"
|
||||||
#include "Script.h"
|
#include "Script.h"
|
||||||
#include "Network.h"
|
#include "Network.h"
|
||||||
|
#include "FileSystemUtils.h"
|
||||||
|
|
||||||
void titlelogic()
|
void titlelogic()
|
||||||
{
|
{
|
||||||
|
@ -107,6 +108,7 @@ void gamecompletelogic2()
|
||||||
map.colstate = 10;
|
map.colstate = 10;
|
||||||
game.gamestate = TITLEMODE;
|
game.gamestate = TITLEMODE;
|
||||||
graphics.fademode = 4;
|
graphics.fademode = 4;
|
||||||
|
FILESYSTEM_unmountassets(); // should be before music.playef(18)
|
||||||
music.playef(18);
|
music.playef(18);
|
||||||
game.returntomenu(Menu::play);
|
game.returntomenu(Menu::play);
|
||||||
game.createmenu(Menu::gamecompletecontinue);
|
game.createmenu(Menu::gamecompletecontinue);
|
||||||
|
|
|
@ -3589,6 +3589,7 @@ void editorlogic()
|
||||||
script.hardreset();
|
script.hardreset();
|
||||||
graphics.fademode = 4;
|
graphics.fademode = 4;
|
||||||
music.haltdasmusik();
|
music.haltdasmusik();
|
||||||
|
FILESYSTEM_unmountassets(); // should be before music.play(6)
|
||||||
music.play(6);
|
music.play(6);
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
ed.settingsmod=false;
|
ed.settingsmod=false;
|
||||||
|
|
Loading…
Reference in a new issue