diff --git a/src/Interface.cpp b/src/Interface.cpp index 4fce4cfc..dac2c4e3 100644 --- a/src/Interface.cpp +++ b/src/Interface.cpp @@ -120,6 +120,11 @@ bool NoObjects() return true; } +int NumberOfObjects() +{ + return global_objects.size(); +} + void RemoveGlobalObject(int id) { if (global_objects.count(id) != 0) diff --git a/src/Interface.h b/src/Interface.h index 9aff6742..9c303680 100644 --- a/src/Interface.h +++ b/src/Interface.h @@ -197,6 +197,7 @@ void UpdateAspectRatio(float width, float heigth); int AddGlobalObject(Object & a); Object& get_glob_obj(int id); bool NoObjects(); +int NumberOfObjects(); void RemoveGlobalObject(int id); void RemoveAllObjects(); void Add2DeleteQueue(int id); diff --git a/src/Main.cpp b/src/Main.cpp index 3f4c815f..1eef9166 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -331,7 +331,8 @@ int main(int argc, char *argv[]) { { if (game_mode == MAIN_MENU) { - ConfirmExit(&scene, &overlays); + if(NumberOfObjects() < 2) + ConfirmExit(&scene, &overlays); } else if (game_mode == CONTROLS || game_mode == LEVELS) { @@ -353,13 +354,7 @@ int main(int argc, char *argv[]) { { //if no interface objects created if (NoObjects()) - { ConfirmEditorExit(&scene, &overlays); - } - else if(get_glob_obj(focused).action_time < 0.f)//remove confirm window - { - RemoveGlobalObject(focused); - } } } else if (keycode == SETTINGS.stg.control_mapping[RESTART])