mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-23 20:36:53 +01:00
Improve autoload inheritance error message
Autoloaded scripts should always inherit from Node. When you run a project that tries to autoload a script which doesn’t inherit from Node, then Godot gives an error. Before this change, the error said “Script does not inherit a Node”. That error message is a little bit misleading. If a class inherits a Node, then one of its superclasses has a Node. If a class inherits _from_ Node, then one of its superclasses is Node. This change corrects that mistake. Fixes #59884. (cherry picked from commit 1cc7e7ec33a652647d63cb32fa164eceef87c653)
This commit is contained in:
parent
e34661999f
commit
983eec5521
@ -386,7 +386,7 @@ Node *EditorAutoloadSettings::_create_autoload(const String &p_path) {
|
||||
Ref<Script> s = res;
|
||||
StringName ibt = s->get_instance_base_type();
|
||||
bool valid_type = ClassDB::is_parent_class(ibt, "Node");
|
||||
ERR_FAIL_COND_V_MSG(!valid_type, nullptr, "Script does not inherit a Node: " + p_path + ".");
|
||||
ERR_FAIL_COND_V_MSG(!valid_type, nullptr, "Script does not inherit from Node: " + p_path + ".");
|
||||
|
||||
Object *obj = ClassDB::instance(ibt);
|
||||
|
||||
|
@ -1861,7 +1861,7 @@ bool Main::start() {
|
||||
Ref<Script> script_res = res;
|
||||
StringName ibt = script_res->get_instance_base_type();
|
||||
bool valid_type = ClassDB::is_parent_class(ibt, "Node");
|
||||
ERR_CONTINUE_MSG(!valid_type, "Script does not inherit a Node: " + path);
|
||||
ERR_CONTINUE_MSG(!valid_type, "Script does not inherit from Node: " + path);
|
||||
|
||||
Object *obj = ClassDB::instance(ibt);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user