File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -4859,7 +4859,7 @@ static void handle_cmdline_options(String glue_dir_path) {
48594859}
48604860
48614861static void cleanup_and_exit_godot () {
4862- // Exit once done
4862+ // Exit once done.
48634863 Main::cleanup (true );
48644864 ::exit (0 );
48654865}
@@ -4878,7 +4878,7 @@ void BindingsGenerator::handle_cmdline_args(const List<String> &p_cmdline_args)
48784878 elem = elem->next ();
48794879 } else {
48804880 ERR_PRINT (generate_all_glue_option + " : No output directory specified (expected path to '{GODOT_ROOT}/modules/mono/glue')." );
4881- // Exit once done with invalid command line arguments
4881+ // Exit once done with invalid command line arguments.
48824882 cleanup_and_exit_godot ();
48834883 }
48844884
@@ -4889,8 +4889,14 @@ void BindingsGenerator::handle_cmdline_args(const List<String> &p_cmdline_args)
48894889 }
48904890
48914891 if (glue_dir_path.length ()) {
4892- handle_cmdline_options (glue_dir_path);
4893- // Exit once done
4892+ if (Engine::get_singleton ()->is_editor_hint () ||
4893+ Engine::get_singleton ()->is_project_manager_hint ()) {
4894+ handle_cmdline_options (glue_dir_path);
4895+ } else {
4896+ // Running from a project folder, which doesn't make sense and crashes.
4897+ ERR_PRINT (generate_all_glue_option + " : Cannot generate Mono glue while running a game project. Change current directory or enable --editor." );
4898+ }
4899+ // Exit once done.
48944900 cleanup_and_exit_godot ();
48954901 }
48964902}
You can’t perform that action at this time.
0 commit comments