From ec1b78be905c7bf31ffbf9707353f9c5b8d5c8bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophyl=20Hoguet?= Date: Sun, 12 Dec 2021 19:40:45 +0100 Subject: [PATCH] remove lightbulb error itself --- game.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game.c b/game.c index 9dcf934..75dc9ad 100644 --- a/game.c +++ b/game.c @@ -204,7 +204,7 @@ void game_update_flags(game g) { addF_LIGHTED(g, i, j); // add FLIGHTED on the 4 directions, when a wall is hit stop this direction, when another lightbulb is hit put the initial lighbulb on error int tab[] = {-1, 0, 1, 0, 0, -1, 0, 1}; - for (int x = 1; x <= max(g->width, g->height); x++) { + for (int x = 1; x < max(g->width, g->height); x++) { for (uint y = 0; y < 7 /*tab size*/; y = y + 2) { if (/* test if both tab are not 0*/ tab[y] != tab[y + 1] && (/* normal check */ (j + x * tab[y + 1] >= 0 && j + x * tab[y + 1] < g->width && i + x * tab[y] >= 0 &&