diff options
author | Sofox <sofoxx@gmail.com> | 2024-09-23 19:59:44 +0100 |
---|---|---|
committer | Sofox <sofoxx@gmail.com> | 2024-09-23 20:22:26 +0100 |
commit | 633df0b29c7ec602377ea7367f7ad047f90b90f1 (patch) | |
tree | 337053c5ed49ca8df1b0aab07696fafe5125f524 | |
parent | efc7c628b06771773f89eb0030666fab6fa62e19 (diff) | |
download | redot-engine-633df0b29c7ec602377ea7367f7ad047f90b90f1.tar.gz |
Handle handle_modes being undefined by giving default values rather than flagging error
-rw-r--r-- | scene/resources/animation.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index a2ed6af23c..2a576a5062 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -321,8 +321,12 @@ bool Animation::_set(const StringName &p_name, const Variant &p_value) { Vector<real_t> times = d["times"]; Vector<real_t> values = d["points"]; #ifdef TOOLS_ENABLED - ERR_FAIL_COND_V(!d.has("handle_modes"), false); - Vector<int> handle_modes = d["handle_modes"]; + Vector<int> handle_modes; + if (d.has("handle_modes")) { + handle_modes = d["handle_modes"]; + } else { + handle_modes.resize_zeroed(times.size()); + } #endif // TOOLS_ENABLED ERR_FAIL_COND_V(times.size() * 5 != values.size(), false); |