Skip to content

Commit 1e1c603

Browse files
committed
Fix BlendSpace point insertion shift
1 parent a864370 commit 1e1c603

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

scene/animation/animation_blend_space_1d.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ void AnimationNodeBlendSpace1D::add_blend_point(const Ref<AnimationRootNode> &p_
169169
if (p_at_index == -1 || p_at_index == blend_points_used) {
170170
p_at_index = blend_points_used;
171171
} else {
172-
for (int i = blend_points_used - 1; i > p_at_index; i--) {
172+
for (int i = blend_points_used; i > p_at_index; i--) {
173173
blend_points[i] = blend_points[i - 1];
174174
}
175175
}

scene/animation/animation_blend_space_2d.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ void AnimationNodeBlendSpace2D::add_blend_point(const Ref<AnimationRootNode> &p_
8181
if (p_at_index == -1 || p_at_index == blend_points_used) {
8282
p_at_index = blend_points_used;
8383
} else {
84-
for (int i = blend_points_used - 1; i > p_at_index; i--) {
84+
for (int i = blend_points_used; i > p_at_index; i--) {
8585
blend_points[i] = blend_points[i - 1];
8686
}
8787
for (int i = 0; i < triangles.size(); i++) {

0 commit comments

Comments
 (0)