Merge pull request #25001 from jlahman/gdscript-export-var-fix

Fixes export PackedScene "reset to default" throwing errors
This commit is contained in:
Rémi Verschelde 2019-01-16 13:17:53 +01:00 committed by GitHub
commit b910b22d74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -4559,6 +4559,10 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
member.line = tokenizer->get_token_line();
member.usages = 0;
member.rpc_mode = rpc_mode;
#ifdef TOOLS_ENABLED
Variant::CallError ce;
member.default_value = Variant::construct(member._export.type, NULL, 0, ce);
#endif
if (current_class->constant_expressions.has(member.identifier)) {
_set_error("A constant named '" + String(member.identifier) + "' already exists in this class (at line: " +