@@ -502,21 +502,9 @@ void AnimationPlayer::play_section(const StringName &p_name, double p_start_time
502
502
playback_queue.clear ();
503
503
}
504
504
505
- if (c.assigned != name) { // Reset.
506
- c.current .pos = p_from_end ? end : start;
507
- c.assigned = name;
508
- emit_signal (SNAME (" current_animation_changed" ), c.assigned );
509
- } else {
510
- if (p_from_end && Math::is_equal_approx (c.current .pos , start)) {
511
- // Animation reset but played backwards, set position to the end.
512
- seek_internal (end, true , true , true );
513
- } else if (!p_from_end && Math::is_equal_approx (c.current .pos , end)) {
514
- // Animation resumed but already ended, set position to the beginning.
515
- seek_internal (start, true , true , true );
516
- } else if (playing) {
517
- return ;
518
- }
519
- }
505
+ c.current .pos = p_from_end ? end : start;
506
+ c.assigned = name;
507
+ emit_signal (SNAME (" current_animation_changed" ), c.assigned );
520
508
521
509
c.seeked = false ;
522
510
c.started = true ;
@@ -586,11 +574,9 @@ void AnimationPlayer::set_current_animation(const String &p_animation) {
586
574
stop ();
587
575
} else if (!is_playing ()) {
588
576
play (p_animation);
589
- } else if (playback. assigned != p_animation) {
577
+ } else {
590
578
float speed = playback.current .speed_scale ;
591
579
play (p_animation, -1.0 , speed, signbit (speed));
592
- } else {
593
- // Same animation, do not replay from start.
594
580
}
595
581
}
596
582
0 commit comments