diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-05-21 14:27:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-21 14:27:32 +0200 |
commit | 9239412027b6c25009efab69dc39650e0d76c56d (patch) | |
tree | d46d4905ac3c6e1752ec22bea710377f12e44e7b | |
parent | 78e223569b6ef79fe1242e29913b1b2076e59d42 (diff) | |
parent | 409562558a1fc6f1978b083f94cb6d06bbc92664 (diff) |
Merge pull request #38891 from bruvzg/fix_doc_const_order
Docs: Fix order of variant constants.
-rw-r--r-- | core/variant_call.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/core/variant_call.cpp b/core/variant_call.cpp index 82b1f29805..404468a7b4 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -1174,6 +1174,9 @@ struct _VariantCall { List<StringName> value_ordered; #endif Map<StringName, Variant> variant_value; +#ifdef DEBUG_ENABLED + List<StringName> variant_value_ordered; +#endif }; static ConstantData *constant_data; @@ -1187,6 +1190,9 @@ struct _VariantCall { static void add_variant_constant(int p_type, StringName p_constant_name, const Variant &p_constant_value) { constant_data[p_type].variant_value[p_constant_name] = p_constant_value; +#ifdef DEBUG_ENABLED + constant_data[p_type].variant_value_ordered.push_back(p_constant_name); +#endif } }; @@ -1652,8 +1658,13 @@ void Variant::get_constants_for_type(Variant::Type p_type, List<StringName> *p_c #endif } +#ifdef DEBUG_ENABLED + for (List<StringName>::Element *E = cd.variant_value_ordered.front(); E; E = E->next()) { + p_constants->push_back(E->get()); +#else for (Map<StringName, Variant>::Element *E = cd.variant_value.front(); E; E = E->next()) { p_constants->push_back(E->key()); +#endif } } |