You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00: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.
This commit is contained in:
@@ -2336,7 +2336,7 @@ bool Main::start() {
|
||||
} else if (script_res.is_valid()) {
|
||||
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: " + info.path);
|
||||
ERR_CONTINUE_MSG(!valid_type, "Script does not inherit from Node: " + info.path);
|
||||
|
||||
Object *obj = ClassDB::instantiate(ibt);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user