Fix SelectLevel not popping current running state
This commit is contained in:
parent
d7c78e5d65
commit
fe10a149e5
@ -31,10 +31,17 @@ static void _ui_Action_ReturnToTitle(System_UI *sys, ui_Part *part, uintptr_t da
|
|||||||
sys->super->camera->target = NULL;
|
sys->super->camera->target = NULL;
|
||||||
}
|
}
|
||||||
static void _ui_Action_SelectLevel(System_UI *sys, ui_Part *part, uintptr_t data) {
|
static void _ui_Action_SelectLevel(System_UI *sys, ui_Part *part, uintptr_t data) {
|
||||||
|
while (vector_Size(sys->state) > 0 && ui_CurrentState(sys) != ui_TitleMenu) {
|
||||||
|
INFO("popping \"%s\"", ui_StateTitle[ui_CurrentState(sys)]);
|
||||||
|
ui_Action_PopState(sys, part, data);
|
||||||
|
}
|
||||||
|
sys->super->paused = false;
|
||||||
|
if (vector_Size(sys->state) == 0)
|
||||||
|
WARN("new state stack is now empty, ohno");
|
||||||
|
|
||||||
const char *level = (const char *)data;
|
const char *level = (const char *)data;
|
||||||
app_QueueLoadLevel(sys->super, level);
|
app_QueueLoadLevel(sys->super, level);
|
||||||
ui_Action_PushState(sys, part, (uintptr_t)ui_Running);
|
ui_Action_PushState(sys, part, (uintptr_t)ui_Running);
|
||||||
sys->super->paused = false;
|
|
||||||
}
|
}
|
||||||
static void _ui_Action_StartFromBeginning(System_UI *sys, ui_Part *part, uintptr_t data) {
|
static void _ui_Action_StartFromBeginning(System_UI *sys, ui_Part *part, uintptr_t data) {
|
||||||
_ui_Action_SelectLevel(sys, part, (uintptr_t) "intro.txt");
|
_ui_Action_SelectLevel(sys, part, (uintptr_t) "intro.txt");
|
||||||
|
Loading…
Reference in New Issue
Block a user