From 3f8a4cc7193e964f716fde2cd28a946669e2d8d6 Mon Sep 17 00:00:00 2001 From: Paul Joannon Date: Mon, 15 Jan 2018 01:04:33 +0100 Subject: [PATCH] Fix bug when launching a game with no main scene Check for a main scene after loading project settings and exit if there's none (except if launching in editor mode). --- main/main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main/main.cpp b/main/main.cpp index 0b231b9d30a..87a0e953b02 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -743,6 +743,15 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph OS::get_singleton()->print("Error: Could not load game path '%s'.\n", game_path.ascii().get_data()); goto error; +#endif + } else if (String(GLOBAL_DEF("application/run/main_scene", "")) == "") { +#ifdef TOOLS_ENABLED + if (!editor) { +#endif + OS::get_singleton()->print("Error: Can't run project: no main scene defined.\n"); + goto error; +#ifdef TOOLS_ENABLED + } #endif }