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

This commit is contained in:
Danil Alexeev 2022-11-10 19:22:52 +03:00
parent dca5cb8e40
commit 0f8e28f818
No known key found for this signature in database
GPG key ID: 124453E157DA8DC7

View file

@ -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