From f6901505af9e0747042d7329c902e7e7cc3628a8 Mon Sep 17 00:00:00 2001 From: _N3m0 Date: Sun, 17 Mar 2024 16:52:15 +0100 Subject: [PATCH] save record in memory --- main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index acca4dc..5d47a82 100644 --- a/main.c +++ b/main.c @@ -276,7 +276,7 @@ int main(void) SetConfigFlags(FLAG_WINDOW_RESIZABLE); #ifdef RELEASE - // SetTraceLogLevel(LOG_ERROR); + SetTraceLogLevel(LOG_ERROR); #endif // RELEASE InitWindow(screen_width, screen_height, "mineur"); @@ -505,10 +505,12 @@ int main(void) } if (game_state != LOSE && count_undiscovered_cell <= nb_bomb) { - if (timer < atoi(timer_record[current_game_type])) + if (timer < atoi(timer_record[current_game_type])) { game_state = RECORD; - else + snprintf(timer_record[current_game_type], GAME_TYPE_NB, "%d", (int) timer); + } else { game_state = WIN; + } } if (game[mouse_map_y][mouse_map_x] == 'X') {