summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-11-30 10:49:09 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-11-30 10:49:09 +0100
commitc868e0b4b98155714b2fe9f468119027eb8317d3 (patch)
tree7f49a1bd1e3212998c974f16dd52fd7f49d6eafb
parent3afa207f1aed8962ae9d6d774ca66b1bcf0a1c45 (diff)
parente10b0c5d981248a68b61de4e4e222b2246322b23 (diff)
Merge pull request #69269 from red1939/red1939/master
Acknowledge that a CLASS kind of a DataType might not have an identifier
-rw-r--r--modules/gdscript/gdscript_parser.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index 24dd94873b..f8fe015c6b 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -3785,15 +3785,14 @@ bool GDScriptParser::export_annotations(const AnnotationNode *p_annotation, Node
}
break;
case GDScriptParser::DataType::CLASS:
- // Can assume type is a global GDScript class.
if (ClassDB::is_parent_class(export_type.native_type, SNAME("Resource"))) {
variable->export_info.type = Variant::OBJECT;
variable->export_info.hint = PROPERTY_HINT_RESOURCE_TYPE;
- variable->export_info.hint_string = export_type.class_type->identifier->name;
+ variable->export_info.hint_string = export_type.to_string();
} else if (ClassDB::is_parent_class(export_type.native_type, SNAME("Node"))) {
variable->export_info.type = Variant::OBJECT;
variable->export_info.hint = PROPERTY_HINT_NODE_TYPE;
- variable->export_info.hint_string = export_type.class_type->identifier->name;
+ variable->export_info.hint_string = export_type.to_string();
} else {
push_error(R"(Export type can only be built-in, a resource, a node or an enum.)", variable);
return false;