diff options
| author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-05-23 15:50:36 -0700 | 
|---|---|---|
| committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-05-23 15:54:12 -0700 | 
| commit | ee146e45b9ccc7f3b5dfd34973df538a42772b84 (patch) | |
| tree | 3b91beb43a2cac1ad16eefa43b21c6d991d49ac1 /web/web_control.c | |
| parent | 15ff00e056a98ab4210dde3d4461a88849d6c1d4 (diff) | |
| download | dartboat-ee146e45b9ccc7f3b5dfd34973df538a42772b84.tar.gz dartboat-ee146e45b9ccc7f3b5dfd34973df538a42772b84.tar.xz | |
store starting player as part of match data
Diffstat (limited to 'web/web_control.c')
| -rw-r--r-- | web/web_control.c | 7 | 
1 files changed, 4 insertions, 3 deletions
| 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) { | 
