From f89aa9ddefb73a40a9041771763a8c34b78d8534 Mon Sep 17 00:00:00 2001 From: Sofox Date: Mon, 23 Sep 2024 19:59:44 +0100 Subject: [PATCH] Handle handle_modes being undefined by giving default values rather than flagging error --- scene/resources/animation.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index a2ed6af23c3a..d0a2aa1fd86a 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -321,8 +321,13 @@ bool Animation::_set(const StringName &p_name, const Variant &p_value) { Vector times = d["times"]; Vector values = d["points"]; #ifdef TOOLS_ENABLED - ERR_FAIL_COND_V(!d.has("handle_modes"), false); - Vector handle_modes = d["handle_modes"]; + Vector handle_modes; + if (d.has("handle_modes")) { + handle_modes = d["handle_modes"]; + } else { + handle_modes.push_back(0); + handle_modes.push_back(0); + } #endif // TOOLS_ENABLED ERR_FAIL_COND_V(times.size() * 5 != values.size(), false);