Merge pull request #53168 from LATRio/53120

This commit is contained in:
Rémi Verschelde 2021-09-28 14:04:10 +02:00 committed by GitHub
commit 9147a6a401
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1438,12 +1438,11 @@ Variant::Type Variant::get_method_return_type(Variant::Type p_type, const String
}
Vector<Variant> Variant::get_method_default_arguments(Variant::Type p_type, const StringName &p_method) {
ERR_FAIL_INDEX_V(p_type, Variant::VARIANT_MAX, Vector<Variant>());
const _VariantCall::TypeFunc &tf = _VariantCall::type_funcs[p_type];
const Map<StringName, _VariantCall::FuncData>::Element *E = tf.functions.find(p_method);
if (!E) {
return Vector<Variant>();
}
ERR_FAIL_COND_V(!E, Vector<Variant>());
return E->get().default_args;
}