Skip to content

Commit

Permalink
Reset board before exit when game is over
Browse files Browse the repository at this point in the history
  • Loading branch information
alewmoose committed Jul 6, 2017
1 parent 9064276 commit e7595ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion TODO
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
- Fix README.md
- Reset board before exit when game is over
6 changes: 6 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ int main(void)
/* block all signals before saving */
sigprocmask(SIG_BLOCK, &all_signals, NULL);
endwin();

if (stats.game_over) {
board_start(&board);
stats.score = 0;
}

save_game(&board, &stats);
return 0;
}

0 comments on commit e7595ca

Please sign in to comment.