summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorIgnacio Etcheverry <ignalfonsore@gmail.com>2017-09-01 16:33:16 +0200
committerIgnacio Etcheverry <ignalfonsore@gmail.com>2017-09-01 16:33:16 +0200
commit27ca7e73135b15f6579f7d784b1b120fb753a86f (patch)
tree236e9a143bc58003d1783aed9f55c736778ca70a /core
parent82208c1e8b85abe3c5e6413220bcdf0e9f2edd38 (diff)
Fixes reversed order of default arguments in MethodInfo
Diffstat (limited to 'core')
-rw-r--r--core/class_db.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/class_db.cpp b/core/class_db.cpp
index 1cb287a143..872e466e72 100644
--- a/core/class_db.cpp
+++ b/core/class_db.cpp
@@ -535,7 +535,13 @@ 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();
- minfo.default_arguments = method->get_default_arguments();
+
+ 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);
+ }
p_methods->push_back(minfo);
}