1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-02 19:13:31 +02:00

Set TITLEMODE if loading level results in error

After the scriptclass::startgamemode refactor, a lot of common code is
still being executed even if the level loading failed. This sets the
game-gamestate to TITLEMODE in gotoerrorloadinglevel(), and also returns
early just in case.

Fixes #975.
This commit is contained in:
Misa 2023-05-17 08:42:50 -07:00
parent 27aa10a18c
commit a5eb361448

View File

@ -2522,6 +2522,7 @@ void scriptclass::translate_dialogue(void)
static void gotoerrorloadinglevel(void)
{
game.gamestate = TITLEMODE;
game.createmenu(Menu::errorloadinglevel);
map.nexttowercolour();
graphics.fademode = FADE_START_FADEIN; /* start fade in */
@ -2832,7 +2833,7 @@ void scriptclass::startgamemode(const enum StartMode mode)
if (!cl.load(filename))
{
gotoerrorloadinglevel();
break;
return;
}
cl.findstartpoint();