Răsfoiți Sursa

Fixes order of default arguments in MethodInfo
This time for real

Ignacio Etcheverry 8 ani în urmă
părinte
comite
d1e00130e9
1 a modificat fișierele cu 3 adăugiri și 5 ștergeri
  1. 3 5
      core/class_db.cpp

+ 3 - 5
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);