Fix AnimatedSprite infinite loop
(cherry picked from commit 3a439a9c03
)
This commit is contained in:
parent
824eaabd7b
commit
7e07d4781a
|
@ -364,14 +364,14 @@ void AnimatedSprite::_notification(int p_what) {
|
|||
return;
|
||||
}
|
||||
|
||||
float speed = frames->get_animation_speed(animation) * speed_scale;
|
||||
if (speed == 0) {
|
||||
return; //do nothing
|
||||
}
|
||||
|
||||
float remaining = get_process_delta_time();
|
||||
|
||||
while (remaining) {
|
||||
float speed = frames->get_animation_speed(animation) * speed_scale;
|
||||
if (speed == 0) {
|
||||
return; //do nothing
|
||||
}
|
||||
|
||||
if (timeout <= 0) {
|
||||
timeout = _get_frame_duration();
|
||||
|
||||
|
|
|
@ -980,14 +980,14 @@ void AnimatedSprite3D::_notification(int p_what) {
|
|||
return;
|
||||
}
|
||||
|
||||
float speed = frames->get_animation_speed(animation);
|
||||
if (speed == 0) {
|
||||
return; //do nothing
|
||||
}
|
||||
|
||||
float remaining = get_process_delta_time();
|
||||
|
||||
while (remaining) {
|
||||
float speed = frames->get_animation_speed(animation);
|
||||
if (speed == 0) {
|
||||
return; // Do nothing.
|
||||
}
|
||||
|
||||
if (timeout <= 0) {
|
||||
timeout = 1.0 / speed;
|
||||
|
||||
|
|
Loading…
Reference in New Issue