From 145ea71bd98064db0a7821518365cf60295a5d8e Mon Sep 17 00:00:00 2001 From: Ulysse Cura Date: Wed, 22 Jul 2026 13:22:30 +0200 Subject: [PATCH] Better lisibility for animation system update func. --- src/ecs/components/animation_system.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/ecs/components/animation_system.c b/src/ecs/components/animation_system.c index 9af0988..fb738c4 100644 --- a/src/ecs/components/animation_system.c +++ b/src/ecs/components/animation_system.c @@ -42,15 +42,15 @@ void animation_system_update(component_t *component) system_data->actual_frame = system_data->actual_frame->prev; system_data->actual_frame_nb--; } - else if(!system_data->loop) - { - system_data->play = false; - } - else + else if(system_data->loop) { system_data->actual_frame = system_data->frames.last; system_data->actual_frame_nb = system_data->frames.size - 1; } + else + { + system_data->play = false; + } } else { @@ -59,15 +59,15 @@ void animation_system_update(component_t *component) system_data->actual_frame = system_data->actual_frame->next; system_data->actual_frame_nb++; } - else if(!system_data->loop) - { - system_data->play = false; - } - else + else if(system_data->loop) { system_data->actual_frame = system_data->frames.first; system_data->actual_frame_nb = 0; } + else + { + system_data->play = false; + } } }