From 0f8e28f818c6650a52c32a509180a09773e29835 Mon Sep 17 00:00:00 2001 From: Danil Alexeev Date: Thu, 10 Nov 2022 19:22:52 +0300 Subject: [PATCH] GDScript 2.0: Fix shift due to skip of non-constant default argument values --- modules/gdscript/gdscript_analyzer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp index 704dda80459..5985891605d 100644 --- a/modules/gdscript/gdscript_analyzer.cpp +++ b/modules/gdscript/gdscript_analyzer.cpp @@ -1163,6 +1163,8 @@ void GDScriptAnalyzer::resolve_function_signature(GDScriptParser::FunctionNode * if (p_function->parameters[i]->default_value->is_constant) { p_function->default_arg_values.push_back(p_function->parameters[i]->default_value->reduced_value); + } else { + p_function->default_arg_values.push_back(Variant()); // Prevent shift. } } #endif // TOOLS_ENABLED