From 6f8ceeed25996190632a47c446fbc803eb447b69 Mon Sep 17 00:00:00 2001 From: betalars Date: Tue, 18 Jul 2023 15:55:54 +0200 Subject: [PATCH] global state will quit game when the last focus is dropped --- src/singletons/global_state.gd | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/singletons/global_state.gd b/src/singletons/global_state.gd index 0defc1d..298009f 100644 --- a/src/singletons/global_state.gd +++ b/src/singletons/global_state.gd @@ -43,7 +43,10 @@ func leave_stage(actor:Object, dropObject: bool = false) -> bool: stage_list.erase(actor) - stage_list.front().has_stage = true + if stage_list != []: + stage_list.front().has_stage = true + else: + get_tree().quit() return false