From 434a32b72df982e72edee155712150061f29318c Mon Sep 17 00:00:00 2001 From: Lyanis Souidi Date: Wed, 7 Dec 2022 19:15:23 +0100 Subject: [PATCH] Correction de bug sur le mode triche MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Lorsque le mode triche était actif, si une touche autre que "T" était pressé, le jeu reprenait sans effectuer les actions nécessaires pour sortit du mode triche. --- src/game.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/game.c b/src/game.c index c4cab74..2d08e95 100644 --- a/src/game.c +++ b/src/game.c @@ -112,11 +112,10 @@ int game(int colonnes, int lignes) { CopierZone(1,0,GAME_MARGIN_RIGHT,GAME_MARGIN_TOP,WINDOW_WIDTH - (GAME_MARGIN_RIGHT + GAME_MARGIN_LEFT),WINDOW_HEIGHT - (GAME_MARGIN_TOP + GAME_MARGIN_BOTTOM),GAME_MARGIN_RIGHT,GAME_MARGIN_TOP); - if (Touche()==XK_t){ - CopierZone(2,0,GAME_MARGIN_RIGHT,GAME_MARGIN_TOP,WINDOW_WIDTH - (GAME_MARGIN_RIGHT + GAME_MARGIN_LEFT),WINDOW_HEIGHT - (GAME_MARGIN_TOP + GAME_MARGIN_BOTTOM),GAME_MARGIN_RIGHT,GAME_MARGIN_TOP); - while (SourisCliquee()); - timer = start_timer(timer); - } + while (Touche()!=XK_t); + CopierZone(2,0,GAME_MARGIN_RIGHT,GAME_MARGIN_TOP,WINDOW_WIDTH - (GAME_MARGIN_RIGHT + GAME_MARGIN_LEFT),WINDOW_HEIGHT - (GAME_MARGIN_TOP + GAME_MARGIN_BOTTOM),GAME_MARGIN_RIGHT,GAME_MARGIN_TOP); + while (SourisCliquee()); + timer = start_timer(timer); } }