From 7a6f6aa8ef3502e2f45e9324e2e4d57235dfb0a6 Mon Sep 17 00:00:00 2001 From: Relintai Date: Tue, 2 Jan 2024 12:43:12 +0100 Subject: [PATCH] Fix non tools build. --- main/main.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/main/main.cpp b/main/main.cpp index 83807bf59..1dfcbe9d7 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -537,6 +537,10 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph bool quiet_stdout = false; int rtm = -1; +#ifndef TOOLS_ENABLED + bool has_script = false; +#endif + String remotefs; String remotefs_pass; @@ -600,6 +604,12 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph goto error; #endif +#ifndef TOOLS_ENABLED + } else if (I->get() == "-s" || I->get() == "--script") { + has_script = true; + +#endif + } else if (I->get() == "-v" || I->get() == "--verbose") { // verbose output OS::get_singleton()->_verbose_stdout = true; @@ -1054,7 +1064,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph #ifdef TOOLS_ENABLED editor = false; #else - if (script.empty()) { + if (!has_script) { const String error_msg = "Error: Couldn't load project data at path \"" + project_path + "\". Is the .pck file missing?\nIf you've renamed the executable, the associated .pck file should also be renamed to match the executable's name (without the extension).\n"; OS::get_singleton()->print("%s", error_msg.utf8().get_data()); OS::get_singleton()->alert(error_msg);