summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-03-09 11:35:28 +0100
committerGitHub <noreply@github.com>2020-03-09 11:35:28 +0100
commit4787da0997a38e16dd0aaacc6adc5d13092fc079 (patch)
tree127a13b49be3c1ded0b83f20daac687c5ec3fd11 /editor
parentee543253ec6ee09d4bfcf0261e3d804368cd8a94 (diff)
parent788765709dfa5e0185cbecffad637dbb545a89aa (diff)
Merge pull request #36934 from akien-mga/variant-defargs
DocData: Fix serialization of Variant default values
Diffstat (limited to 'editor')
-rw-r--r--editor/doc/doc_data.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/editor/doc/doc_data.cpp b/editor/doc/doc_data.cpp
index 3fd9e3182d..38ff9cd5fc 100644
--- a/editor/doc/doc_data.cpp
+++ b/editor/doc/doc_data.cpp
@@ -555,9 +555,11 @@ void DocData::generate(bool p_basic_types) {
argument_doc_from_arginfo(ad, mi.arguments[j]);
ad.name = arginfo.name;
- int defarg = mi.default_arguments.size() - mi.arguments.size() + j;
- if (defarg >= 0)
- ad.default_value = mi.default_arguments[defarg];
+ int darg_idx = mi.default_arguments.size() - mi.arguments.size() + j;
+ if (darg_idx >= 0) {
+ Variant default_arg = mi.default_arguments[darg_idx];
+ ad.default_value = default_arg.get_construct_string();
+ }
method.arguments.push_back(ad);
}
@@ -674,7 +676,6 @@ void DocData::generate(bool p_basic_types) {
argument_doc_from_arginfo(ad, mi.arguments[j]);
int darg_idx = j - (mi.arguments.size() - mi.default_arguments.size());
-
if (darg_idx >= 0) {
Variant default_arg = E->get().default_arguments[darg_idx];
ad.default_value = default_arg.get_construct_string();