From 00a199ab2161504383f384aed72c8cee46ef759a Mon Sep 17 00:00:00 2001 From: Relintai Date: Tue, 2 Jan 2024 12:28:55 +0100 Subject: [PATCH] Allow running standalone scripts in non-editor builds. --- main/main.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/main/main.cpp b/main/main.cpp index 2a5858c52..83807bf59 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1054,11 +1054,13 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph #ifdef TOOLS_ENABLED editor = false; #else - 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); + if (script.empty()) { + 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); - goto error; + goto error; + } #endif }