Fix misleading editor message when redeclaring variables

This commit is contained in:
Mateo de Mayo 2020-10-22 18:32:34 -03:00
parent db422017a3
commit edb79e584a
1 changed files with 1 additions and 1 deletions

View File

@ -2862,7 +2862,6 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) {
return;
}
StringName n = tokenizer->get_token_literal();
tokenizer->advance();
if (current_function) {
for (int i = 0; i < current_function->arguments.size(); i++) {
if (n == current_function->arguments[i]) {
@ -2879,6 +2878,7 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) {
}
check_block = check_block->parent_block;
}
tokenizer->advance();
//must know when the local variable is declared
LocalVarNode *lv = alloc_node<LocalVarNode>();