diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-12-11 15:06:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-11 15:06:38 +0100 |
commit | df2e3e3f7f66612e02f7c76efc39ebbc023e3432 (patch) | |
tree | ba5b2bc8720dd31e149ca0a1176c263b0e87f9d8 /modules | |
parent | cd9d5132854e239726a08098d9029bdd00eee752 (diff) | |
parent | 1b9a7e1c21856a76a6a723734191296d347dd520 (diff) |
Merge pull request #33018 from Xrayez/fix-inst2dict-getters
Fix `inst2dict` calling to getters to retrieve value
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdscript/gdscript_functions.cpp | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/modules/gdscript/gdscript_functions.cpp b/modules/gdscript/gdscript_functions.cpp index bbafef68ed..9e05c7b574 100644 --- a/modules/gdscript/gdscript_functions.cpp +++ b/modules/gdscript/gdscript_functions.cpp @@ -1128,25 +1128,11 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ d["@subpath"] = cp; d["@path"] = p->get_path(); - p = base.ptr(); - - while (p) { - - for (Set<StringName>::Element *E = p->members.front(); E; E = E->next()) { - - Variant value; - if (ins->get(E->get(), value)) { - - String k = E->get(); - if (!d.has(k)) { - d[k] = value; - } - } + for (Map<StringName, GDScript::MemberInfo>::Element *E = base->member_indices.front(); E; E = E->next()) { + if (!d.has(E->key())) { + d[E->key()] = ins->members[E->get().index]; } - - p = p->_base; } - r_ret = d; } } |