Skip to content

Commit

Permalink
Don't draw incorrect flags at game end
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulKlinger committed Aug 2, 2019
1 parent 6aec059 commit caf29de
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions code/applications/mines.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit caf29de

Please sign in to comment.