From caf29de8f090e566b1a65beddea6ff0fcdfa1dae Mon Sep 17 00:00:00 2001 From: Paul Klinger Date: Fri, 2 Aug 2019 11:33:55 +0200 Subject: [PATCH] Don't draw incorrect flags at game end --- code/applications/mines.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/code/applications/mines.c b/code/applications/mines.c index 9237df7..c8e41b8 100644 --- a/code/applications/mines.c +++ b/code/applications/mines.c @@ -144,9 +144,8 @@ static void show_game_state(struct MinesGameState *state) { draw_grid(); for (uint8_t cell_y=0; cell_y < GRID_Y; cell_y++){ for (uint8_t cell_x=0; cell_x < GRID_X; cell_x++){ - if (bitmatrix_get(state->flagged, cell_x, cell_y) - || (state->game_phase == m_END - && bitmatrix_get(state->mines, cell_x, cell_y))) { + if ((state->game_phase != m_END && bitmatrix_get(state->flagged, cell_x, cell_y)) + || (state->game_phase == m_END && bitmatrix_get(state->mines, cell_x, cell_y))) { draw_mine(cell_x, cell_y); } else if (state->game_phase != m_END && !bitmatrix_get(state->revealed, cell_x, cell_y)) { draw_hidden_cell(cell_x, cell_y);