mirror of
https://github.com/godotengine/godot.git
synced 2025-02-18 00:30:43 +00:00
Handle handle_modes being undefined by giving default values rather than flagging error
This commit is contained in:
parent
efc7c628b0
commit
633df0b29c
@ -321,8 +321,12 @@ bool Animation::_set(const StringName &p_name, const Variant &p_value) {
|
|||||||
Vector<real_t> times = d["times"];
|
Vector<real_t> times = d["times"];
|
||||||
Vector<real_t> values = d["points"];
|
Vector<real_t> values = d["points"];
|
||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
ERR_FAIL_COND_V(!d.has("handle_modes"), false);
|
Vector<int> handle_modes;
|
||||||
Vector<int> handle_modes = d["handle_modes"];
|
if (d.has("handle_modes")) {
|
||||||
|
handle_modes = d["handle_modes"];
|
||||||
|
} else {
|
||||||
|
handle_modes.resize_zeroed(times.size());
|
||||||
|
}
|
||||||
#endif // TOOLS_ENABLED
|
#endif // TOOLS_ENABLED
|
||||||
|
|
||||||
ERR_FAIL_COND_V(times.size() * 5 != values.size(), false);
|
ERR_FAIL_COND_V(times.size() * 5 != values.size(), false);
|
||||||
|
Loading…
Reference in New Issue
Block a user