]> git.draconx.ca Git - rrace.git/commitdiff
Clear goal overlay when starting a new game.
authorNick Bowler <nbowler@draconx.ca>
Fri, 6 Jan 2023 03:46:00 +0000 (22:46 -0500)
committerNick Bowler <nbowler@draconx.ca>
Sat, 7 Jan 2023 16:43:14 +0000 (11:43 -0500)
While it doesn't crash the game anymore, starting a new game with
the goal overlay remaining active nevertheless feels very strange.

src/curses.c
src/motif.c

index c0f4265e25fc98054f947cce25290b227e941ab6..2d9ef64a64aceb3075608ef6ed91cd6c3dc28e90 100644 (file)
@@ -422,6 +422,7 @@ void curs_new_game(struct app_state *state)
        game_reset(&state->board);
 
        do_reset_cursor(state);
+       state->view_goal_on_game = 0;
        curs_redraw_game(state, -1);
        curs_redraw_goal(state, -1);
        update_timer(state, 0);
index 57e14758af6891afd120949c0e4936fea1619663..e3ff6c22c587337792b36afc621a49c8511404cf 100644 (file)
@@ -227,6 +227,7 @@ static void proc_new_game(Widget w, XEvent *e, String *argv, Cardinal *argc)
 
        game_reset(&state.board);
 
+       state.flags &= ~FLAG_VIEW_GOAL_ON_GAME;
        x11_redraw_goal(&state, -1, get_shell(w));
        x11_redraw_game(&state, -1);