diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-02-28 10:48:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-28 10:48:16 +0100 |
commit | 2e458842528de94bd8fc581677c7f32dbf3db1c2 (patch) | |
tree | 680a10290013593dfc6b936a7414813e6c30e675 /scene/3d/sprite_3d.cpp | |
parent | 6716af9f839046560087ec07869b40fcfececa05 (diff) | |
parent | 3a439a9c0378d0c6f7d8ce67084863abbe4e87bc (diff) |
Merge pull request #58623 from timothyqiu/animated-sprite
Fix `AnimatedSprite` infinite loop
Diffstat (limited to 'scene/3d/sprite_3d.cpp')
-rw-r--r-- | scene/3d/sprite_3d.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp index b9fb3e9287..ce281c79bc 100644 --- a/scene/3d/sprite_3d.cpp +++ b/scene/3d/sprite_3d.cpp @@ -1019,14 +1019,14 @@ void AnimatedSprite3D::_notification(int p_what) { return; } - float speed = frames->get_animation_speed(animation); - if (speed == 0) { - return; //do nothing - } - double remaining = get_process_delta_time(); while (remaining) { + double speed = frames->get_animation_speed(animation); + if (speed == 0) { + return; // Do nothing. + } + if (timeout <= 0) { timeout = 1.0 / speed; |