diff options
Diffstat (limited to 'web/web_control.c')
-rw-r--r-- | web/web_control.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/web/web_control.c b/web/web_control.c index 4d62c05..c9fb138 100644 --- a/web/web_control.c +++ b/web/web_control.c @@ -22,7 +22,7 @@ void set_active_player(int pn) state->active_player = pn; scoreboard_set_player_active(pn); - if (state->mode == M_PVC && pn == 2) + if (match_player_is_comp(pn)) prompt_bot_visit(); else prompt_visit(); @@ -130,22 +130,18 @@ void handle_next() prompt_select_mode(); } else if (match_is_over()) { if (state->num_darts || - (state->mode == M_PVC && state->legs[1]->rem <= 0)) + match_player_is_comp(match_winning_player())) prompt_end_match(); else prompt_num_darts(); } else { - if (state->mode == M_P) { - set_active_player(1); - } else { - if (state->active_player) - set_active_player(match_next_player()); - else - set_active_player(match_opts->throws_first); - - if (state->mode == M_PVC && state->active_player == 2) - boat_visit(); - } + if (state->active_player) + set_active_player(match_next_player()); + else + set_active_player(match_opts->throws_first); + + if (match_player_is_comp(state->active_player)) + boat_visit(); } prompt_flush(); @@ -283,7 +279,7 @@ void start_match() update_player_rem(1, state->legs[0]->rem); update_player_avg(1, 0); - if (state->mode != M_P) { + if (match_num_players() != 1) { show_player_info(2); update_player_name(2, state->legs[1]->name); update_player_rem(2, state->legs[1]->rem); |