From 05331a5bb93ff33ace86e233e6fac9ed625fb083 Mon Sep 17 00:00:00 2001 From: Yuri Roubinsky Date: Sun, 19 Sep 2021 22:51:14 +0300 Subject: Prevent local constant default value from incorrect override by a global --- modules/gdscript/gdscript_editor.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index f79e5726ce..2f8a054b2a 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -781,6 +781,9 @@ static void _find_identifiers_in_class(const GDScriptParser::ClassNode *p_class, if (p_only_functions) { continue; } + if (r_result.has(member.constant->identifier->name)) { + continue; + } option = ScriptCodeCompletionOption(member.constant->identifier->name, ScriptCodeCompletionOption::KIND_CONSTANT); if (member.constant->initializer) { option.default_value = member.constant->initializer->reduced_value; -- cgit v1.2.3