1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 17:49:43 +01: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) static void gotoerrorloadinglevel(void)
{ {
game.gamestate = TITLEMODE;
game.createmenu(Menu::errorloadinglevel); game.createmenu(Menu::errorloadinglevel);
map.nexttowercolour(); map.nexttowercolour();
graphics.fademode = FADE_START_FADEIN; /* start fade in */ graphics.fademode = FADE_START_FADEIN; /* start fade in */
@ -2832,7 +2833,7 @@ void scriptclass::startgamemode(const enum StartMode mode)
if (!cl.load(filename)) if (!cl.load(filename))
{ {
gotoerrorloadinglevel(); gotoerrorloadinglevel();
break; return;
} }
cl.findstartpoint(); cl.findstartpoint();