From e57ddb3f78b9ee56c8211d17d3cd0068b325b9e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophyl=20Hoguet?= Date: Tue, 11 Jan 2022 20:17:07 +0100 Subject: [PATCH] update flags wrapped --- game.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game.c b/game.c index 09f173d..eb59444 100644 --- a/game.c +++ b/game.c @@ -198,7 +198,7 @@ void game_update_flags(game g) { 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 && i + x * tab[y] < g->height) || - /* wrapping check*/ g->wrapping)) { + /* wrapping check*/ (g->wrapping && (((i + g->height + x * tab[y]) != i) && ((j + g->width + x * tab[y + 1]) % g->width) != j)))) { if (game_is_black(g, ((i + g->height + x * tab[y]) % g->height), ((j + g->width + x * tab[y + 1]) % g->width))) { tab[y] = 0; tab[y + 1] = 0;