GDScript: Make check for exposed classes more consistent
Some places were already checking if classes from ClassDB were exposed, while others didn't. This makes the check more consistent to avoid disparities which can lead to crashes.
This commit is contained in:
parent
22a28e07cc
commit
501c5b0900
5 changed files with 18 additions and 17 deletions
|
|
@ -4677,7 +4677,7 @@ bool GDScriptParser::export_annotations(AnnotationNode *p_annotation, Node *p_ta
|
|||
if (ScriptServer::is_global_class(arg_string)) {
|
||||
native_class = ScriptServer::get_global_class_native_base(arg_string);
|
||||
}
|
||||
if (!ClassDB::class_exists(native_class)) {
|
||||
if (!ClassDB::class_exists(native_class) || !ClassDB::is_class_exposed(native_class)) {
|
||||
push_error(vformat(R"(Invalid argument %d of annotation "@export_node_path": The class "%s" was not found in the global scope.)", i + 1, arg_string), p_annotation->arguments[i]);
|
||||
return false;
|
||||
} else if (!ClassDB::is_parent_class(native_class, SNAME("Node"))) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue