diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2020-11-09 14:34:49 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-09 14:34:49 +0100 |
| commit | 01154f1ad20e7c6707ef1229394a4330eb4e31b7 (patch) | |
| tree | 3a3195b3e39238c7c307b8d7e941a72871f60c0c /editor/animation_track_editor.cpp | |
| parent | eda8f69c19ffaa219bdb0afe67dfb7df17a46d1c (diff) | |
| parent | 221a2a17422dfbb7e0be5ca42fe56b91adb656e3 (diff) | |
Merge pull request #43403 from reduz/variant-constructor-refactor
Refactored variant constructor logic
Diffstat (limited to 'editor/animation_track_editor.cpp')
| -rw-r--r-- | editor/animation_track_editor.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 5471a9907b..6f30d5a492 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -228,9 +228,9 @@ public: if (Variant::can_convert(args[idx].get_type(), t)) { Variant old = args[idx]; Variant *ptrs[1] = { &old }; - args.write[idx] = Variant::construct(t, (const Variant **)ptrs, 1, err); + Variant::construct(t, args.write[idx], (const Variant **)ptrs, 1, err); } else { - args.write[idx] = Variant::construct(t, nullptr, 0, err); + Variant::construct(t, args.write[idx], nullptr, 0, err); } change_notify_deserved = true; d_new["args"] = args; @@ -846,9 +846,9 @@ public: if (Variant::can_convert(args[idx].get_type(), t)) { Variant old = args[idx]; Variant *ptrs[1] = { &old }; - args.write[idx] = Variant::construct(t, (const Variant **)ptrs, 1, err); + Variant::construct(t, args.write[idx], (const Variant **)ptrs, 1, err); } else { - args.write[idx] = Variant::construct(t, nullptr, 0, err); + Variant::construct(t, args.write[idx], nullptr, 0, err); } change_notify_deserved = true; d_new["args"] = args; @@ -4587,7 +4587,8 @@ void AnimationTrackEditor::_add_method_key(const String &p_method) { params.push_back(arg); } else { Callable::CallError ce; - Variant arg = Variant::construct(E->get().arguments[i].type, nullptr, 0, ce); + Variant arg; + Variant::construct(E->get().arguments[i].type, arg, nullptr, 0, ce); params.push_back(arg); } } |