Skip to content

Commit

Permalink
Merge pull request #95405 from TokageItLab/fix-double-seeking
Browse files Browse the repository at this point in the history
Prevent to seek doubly on AnimationPlayerEditor
  • Loading branch information
akien-mga committed Aug 12, 2024
2 parents f19e268 + 81399ae commit 47d0bdd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion editor/plugins/animation_player_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1295,7 +1295,7 @@ void AnimationPlayerEditor::_seek_value_changed(float p_value, bool p_timeline_o
}
pos = CLAMP(pos, 0, (double)anim->get_length() - CMP_EPSILON2); // Hack: Avoid fposmod with LOOP_LINEAR.

if (!p_timeline_only && anim.is_valid()) {
if (!p_timeline_only && anim.is_valid() && (!player->is_valid() || !Math::is_equal_approx(pos, player->get_current_animation_position()))) {
player->seek_internal(pos, true, true, false);
}

Expand Down

0 comments on commit 47d0bdd

Please sign in to comment.