Explorar el Código

GDScript 2.0: Fix shift due to skip of non-constant default argument values

Danil Alexeev hace 2 años
padre
commit
0f8e28f818
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      modules/gdscript/gdscript_analyzer.cpp

+ 2 - 0
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