diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-04-16 12:41:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-16 12:41:12 +0200 |
commit | 30ab5c9baae1cad3e157d906395a4eb8cef77e42 (patch) | |
tree | fbc50c5a71d9a9324f480ade4cc0b90c61e7d6e3 /main | |
parent | 45a036feeca6a079c5dd9c96b7e599294af5c152 (diff) | |
parent | 2ab9515b0750b18717196e56ca63dae410e0f61f (diff) |
Merge pull request #36868 from Calinou/improve-cli-script-error-message
Tweak the error message when trying to run an invalid script from CLI
Diffstat (limited to 'main')
-rw-r--r-- | main/main.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/main/main.cpp b/main/main.cpp index fb42f71a75..a95af44215 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1675,7 +1675,7 @@ bool Main::start() { return false; } - if (script_res->can_instance() /*&& script_res->inherits_from("SceneTreeScripted")*/) { + if (script_res->can_instance()) { StringName instance_type = script_res->get_instance_base_type(); Object *obj = ClassDB::instance(instance_type); @@ -1683,7 +1683,7 @@ bool Main::start() { if (!script_loop) { if (obj) memdelete(obj); - ERR_FAIL_V_MSG(false, "Can't load script '" + script + "', it does not inherit from a MainLoop type."); + ERR_FAIL_V_MSG(false, vformat("Can't load the script \"%s\" as it doesn't inherit from SceneTree or MainLoop.", script)); } script_loop->set_init_script(script_res); |