summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Alexsander <michaelalexsander@protonmail.com>2020-04-23 21:45:50 -0300
committerMichael Alexsander <michaelalexsander@protonmail.com>2020-04-23 21:45:50 -0300
commitb081e954cc70ef08f3ea833bfe4698b0e80a0f5b (patch)
tree21c3c506e35f02d868760c82a4b6aefb39699984
parent43f0767390cabd337b31cf777fa5c04251c68fbc (diff)
Fix crash when changing time value of multiple animation keys at once via inspector
-rw-r--r--editor/animation_track_editor.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp
index f10e439f10..b7c8769f64 100644
--- a/editor/animation_track_editor.cpp
+++ b/editor/animation_track_editor.cpp
@@ -754,14 +754,17 @@ public:
for (Map<int, List<float>>::Element *E = key_ofs_map.front(); E; E = E->next()) {
+ int key = 0;
for (List<float>::Element *F = E->value().front(); F; F = F->next()) {
float key_ofs = F->get();
- if (from != key_ofs)
+ if (from != key_ofs) {
+ key++;
continue;
+ }
int track = E->key();
- key_ofs_map[track][key_ofs] = to;
+ key_ofs_map[track][key] = to;
if (setting)
return;