From c31de323f0f20ccc36cd34165af612c399c230db Mon Sep 17 00:00:00 2001 From: Nakidai Date: Wed, 1 Nov 2023 18:34:19 +0300 Subject: [PATCH] Fix bug when game freezes on max possible score --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 380054c..3e34605 100644 --- a/src/main.c +++ b/src/main.c @@ -68,7 +68,7 @@ int main(int argc, char **argv) player->direction = LEFT; break; } - if (playerDoTick(player, food)) + if (playerDoTick(player, food) && player->score >= SIZE*SIZE - 1) food = generateFood(player); head_x = player->head->x; head_y = player->head->y;