From edb79e584a0a5fbc0eda4cead45bd579f738ff19 Mon Sep 17 00:00:00 2001 From: Mateo de Mayo Date: Thu, 22 Oct 2020 18:32:34 -0300 Subject: [PATCH] Fix misleading editor message when redeclaring variables --- modules/gdscript/gdscript_parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index daf74fa7e73..e3a8d0abcb6 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -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();