]> git.draconx.ca Git - rrace.git/blobdiff - src/motif_ui.c
Check victory condition so the game is winnable.
[rrace.git] / src / motif_ui.c
index 40f463289ca12db1bc72f5658abd564dc1a91e95..279f550ffc80bd1806636e552ed0673adaaab47f 100644 (file)
@@ -239,6 +239,11 @@ static void game_input(Widget w, void *data, void *cb_data)
                return;
 
        if (game_do_move(&state->board, x, y) == 0) {
+               if (game_check_goal(&state->board)) {
+                       printf("You win!\n");
+                       game_finish(&state->board);
+               }
+
                x11_redraw_game(state);
        }
 }