diff options
author | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2017-09-02 20:43:40 +0200 |
---|---|---|
committer | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2017-09-02 20:43:40 +0200 |
commit | d1e00130e93c9d2e2868bdfb4b7a1287026404df (patch) | |
tree | 8924abd949515081bb439fee4031832f10e594ba /core | |
parent | dac150108ab3c1f41d5fd86cc6853f883064caaf (diff) |
Fixes order of default arguments in MethodInfo
This time for real
Diffstat (limited to 'core')
-rw-r--r-- | core/class_db.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/core/class_db.cpp b/core/class_db.cpp index 872e466e72..f5ddd9c761 100644 --- a/core/class_db.cpp +++ b/core/class_db.cpp @@ -536,11 +536,9 @@ void ClassDB::get_method_list(StringName p_class, List<MethodInfo> *p_methods, b minfo.return_val = method->get_return_info(); minfo.flags = method->get_hint_flags(); - int defval_count = method->get_default_argument_count(); - minfo.default_arguments.resize(defval_count); - - for (int i = 0; i < defval_count; i++) { - minfo.default_arguments[i] = method->get_default_argument(defval_count - i - 1); + for (int i = 0; i < method->get_argument_count(); i++) { + if (method->has_default_argument(i)) + minfo.default_arguments.push_back(method->get_default_argument(i)); } p_methods->push_back(minfo); |