Merge pull request #47330 from Blackiris/fix-corrupt-scene-when-export-has-setter

Fix corrupt scene when export var has setter
This commit is contained in:
George Marques 2021-04-14 10:00:57 -03:00 committed by GitHub
commit 8fc4a732de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -811,6 +811,7 @@ GDScriptParser::VariableNode *GDScriptParser::parse_variable(bool p_allow_proper
VariableNode *variable = alloc_node<VariableNode>();
variable->identifier = parse_identifier();
variable->export_info.name = variable->identifier->name;
if (match(GDScriptTokenizer::Token::COLON)) {
if (check(GDScriptTokenizer::Token::NEWLINE)) {
@ -860,8 +861,6 @@ GDScriptParser::VariableNode *GDScriptParser::parse_variable(bool p_allow_proper
end_statement("variable declaration");
variable->export_info.name = variable->identifier->name;
return variable;
}