Fix type check in AnimationTrackKeyEdit for methods

(cherry picked from commit ad769903b0)
This commit is contained in:
Ninni Pipping 2023-03-15 19:32:06 +01:00 committed by Yuri Sizov
parent c683fa9971
commit 131ce4acf6
1 changed files with 2 additions and 2 deletions

View File

@ -201,7 +201,7 @@ bool AnimationTrackKeyEdit::_set(const StringName &p_name, const Variant &p_valu
if (t != args[idx].get_type()) { if (t != args[idx].get_type()) {
Callable::CallError err; Callable::CallError err;
if (Variant::can_convert(args[idx].get_type(), t)) { if (Variant::can_convert_strict(args[idx].get_type(), t)) {
Variant old = args[idx]; Variant old = args[idx];
Variant *ptrs[1] = { &old }; Variant *ptrs[1] = { &old };
Variant::construct(t, args.write[idx], (const Variant **)ptrs, 1, err); Variant::construct(t, args.write[idx], (const Variant **)ptrs, 1, err);
@ -786,7 +786,7 @@ bool AnimationMultiTrackKeyEdit::_set(const StringName &p_name, const Variant &p
if (t != args[idx].get_type()) { if (t != args[idx].get_type()) {
Callable::CallError err; Callable::CallError err;
if (Variant::can_convert(args[idx].get_type(), t)) { if (Variant::can_convert_strict(args[idx].get_type(), t)) {
Variant old = args[idx]; Variant old = args[idx];
Variant *ptrs[1] = { &old }; Variant *ptrs[1] = { &old };
Variant::construct(t, args.write[idx], (const Variant **)ptrs, 1, err); Variant::construct(t, args.write[idx], (const Variant **)ptrs, 1, err);