From d73f7804a86236d1a76cfbf50eab47ab7723166a Mon Sep 17 00:00:00 2001 From: Klemen Plestenjak Date: Fri, 29 Dec 2023 20:04:17 +0100 Subject: [PATCH] Always remove easing after it is finished --- game/systems/s_animation.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/game/systems/s_animation.c b/game/systems/s_animation.c index 68f2588..4f83248 100644 --- a/game/systems/s_animation.c +++ b/game/systems/s_animation.c @@ -57,12 +57,12 @@ void updateEasingSystem(ecs_iter_t *it) { for (i32 i = 0; i < it->count; i++) { ecs_entity_t entity = it->entities[i]; - if (!ecs_has_id(ECS, entity, easing[i].compID)) - continue; if (easing[i].elapsed > easing[i].duration) { ecs_remove(ECS, entity, Easing); continue; } + if (!ecs_has_id(ECS, entity, easing[i].compID)) + continue; easing[i].elapsed += dt; f32 alpha = easing[i].elapsed / easing[i].duration; alpha = BZ_MIN(1.0f, alpha);