From b9096e362600468ae1be1896936081580094742a Mon Sep 17 00:00:00 2001 From: Linus Probert Date: Fri, 10 Oct 2025 15:18:55 +0200 Subject: [PATCH] Nicer cleanup of player skill animations --- src/player.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/player.c b/src/player.c index 017f7905..5809fbda 100644 --- a/src/player.c +++ b/src/player.c @@ -478,18 +478,6 @@ render_skill_animations(Player *player, Camera *cam) } } -static void -destroy_skill_animations(LinkedList *skillAnimations) -{ - LinkedList *next = skillAnimations; - LinkedList *tmp; - while (next != NULL) { - tmp = next; - next = next->next; - free(tmp); - } -} - static void use_skill(Player *player, Skill *skill, SkillData *skillData) { @@ -887,7 +875,9 @@ player_destroy(Player *player) player->skills[i] = NULL; } - destroy_skill_animations(player->skillAnimations); + while (player->skillAnimations) { + linkedlist_pop(&player->skillAnimations); + } particle_emitter_destroy(player->bleed_emitter);