From ee146e45b9ccc7f3b5dfd34973df538a42772b84 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Mon, 23 May 2022 15:50:36 -0700 Subject: store starting player as part of match data --- web/web_control.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'web/web_control.c') diff --git a/web/web_control.c b/web/web_control.c index d06e17e..96c455e 100644 --- a/web/web_control.c +++ b/web/web_control.c @@ -135,7 +135,7 @@ void handle_next() if (state->m->active_player) set_active_player(match_next_player(state->m)); else - set_active_player(match_opts->throws_first); + set_active_player(state->m->starting_player); if (match_player_is_comp(state->m->active_player)) boat_visit(); @@ -181,7 +181,7 @@ static void undo_active() update_player_avg(state->m->active_player, 0); update_player_rem(state->m->active_player, l->rem); - state->m->active_player = match_last_player_to_throw(state->m); + state->m->active_player = match_prev_throw_player(state->m); } void user_undo() @@ -202,7 +202,7 @@ void user_undo() return; } - state->m->active_player = match_last_player_to_throw(state->m); + state->m->active_player = match_prev_throw_player(state->m); while (match_player_is_comp(state->m->active_player)) undo_active(); undo_active(); @@ -233,6 +233,7 @@ void start_match() match_opts->players[i].type, match_opts->players[i].name, match_opts->start_pts); + state->m->starting_player = match_opts->throws_first; scoreboard_show_info(state->m->n_players); for (int i = 1; i <= state->m->n_players; ++i) { -- cgit v1.2.3-70-g09d2