From 09907a28b33d586689a2b5aa015b22555849aca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Furkan=20T=C3=BCrkal?= Date: Tue, 18 Jun 2019 23:12:32 +0300 Subject: added forgotten err_fail_index check --- scene/animation/animation_node_state_machine.cpp | 3 +++ scene/resources/animation.cpp | 8 ++++++++ 2 files changed, 11 insertions(+) (limited to 'scene') diff --git a/scene/animation/animation_node_state_machine.cpp b/scene/animation/animation_node_state_machine.cpp index 60f8806b25..a2411743d4 100644 --- a/scene/animation/animation_node_state_machine.cpp +++ b/scene/animation/animation_node_state_machine.cpp @@ -599,6 +599,9 @@ void AnimationNodeStateMachine::remove_node(const StringName &p_name) { { Ref node = states[p_name].node; + + ERR_FAIL_COND(node.is_null()); + node->disconnect("tree_changed", this, "_tree_changed"); } diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index b49b551252..18ccd35842 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -1425,7 +1425,9 @@ void Animation::track_set_key_value(int p_track, int p_key_idx, const Variant &p TransformTrack *tt = static_cast(t); ERR_FAIL_INDEX(p_key_idx, tt->transforms.size()); + Dictionary d = p_value; + if (d.has("location")) tt->transforms.write[p_key_idx].value.loc = d["location"]; if (d.has("rotation")) @@ -1438,6 +1440,7 @@ void Animation::track_set_key_value(int p_track, int p_key_idx, const Variant &p ValueTrack *vt = static_cast(t); ERR_FAIL_INDEX(p_key_idx, vt->values.size()); + vt->values.write[p_key_idx].value = p_value; } break; @@ -1445,11 +1448,14 @@ void Animation::track_set_key_value(int p_track, int p_key_idx, const Variant &p MethodTrack *mt = static_cast(t); ERR_FAIL_INDEX(p_key_idx, mt->methods.size()); + Dictionary d = p_value; + if (d.has("method")) mt->methods.write[p_key_idx].method = d["method"]; if (d.has("args")) mt->methods.write[p_key_idx].params = d["args"]; + } break; case TYPE_BEZIER: { @@ -1469,6 +1475,7 @@ void Animation::track_set_key_value(int p_track, int p_key_idx, const Variant &p case TYPE_AUDIO: { AudioTrack *at = static_cast(t); + ERR_FAIL_INDEX(p_key_idx, at->values.size()); Dictionary k = p_value; ERR_FAIL_COND(!k.has("start_offset")); @@ -1483,6 +1490,7 @@ void Animation::track_set_key_value(int p_track, int p_key_idx, const Variant &p case TYPE_ANIMATION: { AnimationTrack *at = static_cast(t); + ERR_FAIL_INDEX(p_key_idx, at->values.size()); at->values.write[p_key_idx].value = p_value; -- cgit v1.2.3