From 788765709dfa5e0185cbecffad637dbb545a89aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Mon, 9 Mar 2020 10:51:17 +0100 Subject: DocData: Fix serialization of Variant default values Co-authored-by: Bojidar Marinov --- editor/doc/doc_data.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'editor') 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(); -- cgit v1.2.3