From 28ef3dd7bf25193fe6f97780159d900ef16a7c6b Mon Sep 17 00:00:00 2001 From: Misa Date: Wed, 17 May 2023 11:45:21 -0700 Subject: [PATCH] Use quittomenu in gotoerrorloadinglevel game.quittomenu() correctly resets state, as it's the function that's always used when quitting to menu. This fixes a bug where if a level with assets failed to load, it wouldn't unload the assets. --- desktop_version/src/Script.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index 3a1b6d5f..6b8de1a6 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -2522,10 +2522,8 @@ void scriptclass::translate_dialogue(void) static void gotoerrorloadinglevel(void) { - game.gamestate = TITLEMODE; + game.quittomenu(); game.createmenu(Menu::errorloadinglevel); - map.nexttowercolour(); - graphics.fademode = FADE_START_FADEIN; /* start fade in */ music.currentsong = -1; /* otherwise music.play won't work */ music.play(6); /* title screen music */ }