Browse Source

Merge pull request #43019 from mateosss/3.2

[3.2] Quickfix for misleading editor message when redeclaring variables
Rémi Verschelde 4 years ago
parent
commit
da9ef8993d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      modules/gdscript/gdscript_parser.cpp

+ 1 - 1
modules/gdscript/gdscript_parser.cpp

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