summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2020-03-06 22:57:02 +0100
committerHugo Locurcio <hugo.locurcio@hugo.pro>2020-03-06 22:58:35 +0100
commit2ab9515b0750b18717196e56ca63dae410e0f61f (patch)
treebb9b58c77f4f35e25a9a6dbcf33f8527f8d8add3 /main
parent42595085a5a22f3b5399844d06e89631c42e8981 (diff)
Tweak the error message when trying to run an invalid script from CLI
Diffstat (limited to 'main')
-rw-r--r--main/main.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/main/main.cpp b/main/main.cpp
index d8a9cc87a7..5d011f4f9c 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -1598,7 +1598,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);
@@ -1606,7 +1606,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);