From 75fb0965f18543e8ac1698f948b08a797ed050a7 Mon Sep 17 00:00:00 2001 From: Nakidai Date: Sun, 29 Oct 2023 23:35:03 +0300 Subject: [PATCH] Fix player creating --- src/player.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/player.c b/src/player.c index 6461177..2e66033 100644 --- a/src/player.c +++ b/src/player.c @@ -6,14 +6,14 @@ Player *playerCreate(Direction direction, int x, int y, int score) Player *player = (Player *)malloc(sizeof(Player)); PlayerNode *head = (PlayerNode *)malloc(sizeof(PlayerNode)); + head->x = x; + head->y = y; + head->next = NULL; + player->tail = head; player->head = head; player->score = score; player->direction = direction; - - head->x = x; - head->y = y; - head->next = NULL; } void playerFree(Player *player)