Skip to content

Commit d2e9df8

Browse files
authored
Nicer cleanup of player skill animations (#140)
1 parent e6dbdf4 commit d2e9df8

1 file changed

Lines changed: 3 additions & 13 deletions

File tree

src/player.c

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -478,18 +478,6 @@ render_skill_animations(Player *player, Camera *cam)
478478
}
479479
}
480480

481-
static void
482-
destroy_skill_animations(LinkedList *skillAnimations)
483-
{
484-
LinkedList *next = skillAnimations;
485-
LinkedList *tmp;
486-
while (next != NULL) {
487-
tmp = next;
488-
next = next->next;
489-
free(tmp);
490-
}
491-
}
492-
493481
static void
494482
use_skill(Player *player, Skill *skill, SkillData *skillData)
495483
{
@@ -887,7 +875,9 @@ player_destroy(Player *player)
887875
player->skills[i] = NULL;
888876
}
889877

890-
destroy_skill_animations(player->skillAnimations);
878+
while (player->skillAnimations) {
879+
linkedlist_pop(&player->skillAnimations);
880+
}
891881

892882
particle_emitter_destroy(player->bleed_emitter);
893883

0 commit comments

Comments
 (0)