mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-30 18:04:09 +03:00
Do not close game if custom level has assets issues
It's quite rude to close the game entirely if there is trouble with assets. Instead, just unload the assets and gracefully return to the title screen.
This commit is contained in:
@@ -2634,6 +2634,14 @@ void scriptclass::resetgametomenu(void)
|
||||
game.createmenu(Menu::gameover);
|
||||
}
|
||||
|
||||
static void gotoerrorloadinglevel(void)
|
||||
{
|
||||
game.createmenu(Menu::errorloadinglevel);
|
||||
graphics.fademode = 4; /* start fade in */
|
||||
music.currentsong = -1; /* otherwise music.play won't work */
|
||||
music.play(6); /* title screen music */
|
||||
}
|
||||
|
||||
void scriptclass::startgamemode( int t )
|
||||
{
|
||||
switch(t)
|
||||
@@ -3152,7 +3160,11 @@ void scriptclass::startgamemode( int t )
|
||||
//Initilise the level
|
||||
//First up, find the start point
|
||||
std::string filename = std::string(ed.ListOfMetaData[game.playcustomlevel].filename);
|
||||
ed.load(filename);
|
||||
if (!ed.load(filename))
|
||||
{
|
||||
gotoerrorloadinglevel();
|
||||
break;
|
||||
}
|
||||
ed.findstartpoint();
|
||||
|
||||
game.gamestate = GAMEMODE;
|
||||
@@ -3190,7 +3202,11 @@ void scriptclass::startgamemode( int t )
|
||||
//Initilise the level
|
||||
//First up, find the start point
|
||||
std::string filename = std::string(ed.ListOfMetaData[game.playcustomlevel].filename);
|
||||
ed.load(filename);
|
||||
if (!ed.load(filename))
|
||||
{
|
||||
gotoerrorloadinglevel();
|
||||
break;
|
||||
}
|
||||
ed.findstartpoint();
|
||||
|
||||
game.gamestate = GAMEMODE;
|
||||
|
||||
Reference in New Issue
Block a user