Skip to content

Commit

Permalink
Handle handle_modes being undefined by giving default values rather t…
Browse files Browse the repository at this point in the history
…han flagging error
  • Loading branch information
TheSofox committed Sep 23, 2024
1 parent efc7c62 commit f89aa9d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions scene/resources/animation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,13 @@ 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.push_back(0);
handle_modes.push_back(0);
}
#endif // TOOLS_ENABLED

ERR_FAIL_COND_V(times.size() * 5 != values.size(), false);
Expand Down

0 comments on commit f89aa9d

Please sign in to comment.