Fix bug when game freezes on max possible score

fix-mingw
Nakidai 2023-11-01 18:34:19 +03:00
parent bcf6465f4e
commit c31de323f0
Signed by untrusted user who does not match committer: nakidai
GPG Key ID: 914675D395210A97
1 changed files with 1 additions and 1 deletions

View File

@ -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;