From 7797f45a97681ca513cb75a7e6a322be3ec5003a Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Sat, 21 May 2022 02:03:13 -0700 Subject: web: remove hard-coded match modes --- web/web_control.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'web/web_control.c') diff --git a/web/web_control.c b/web/web_control.c index a5edb82..c561250 100644 --- a/web/web_control.c +++ b/web/web_control.c @@ -235,16 +235,11 @@ void user_num_darts(int n) void start_match() { match_new(); - match_add_player(match_opts->start_pts, match_opts->p1_type, - match_opts->p1_name); - match_add_player(match_opts->start_pts, match_opts->p2_type, - match_opts->p2_name ? match_opts->p2_name : "oi"); - if (match_opts->mode == M_PVPVP) - match_add_player(match_opts->start_pts, PT_USER, "Player 3"); - else if (match_opts->mode == M_PVCVCVC) { - match_add_player(match_opts->start_pts, PT_COMP, "Computer 2"); - match_add_player(match_opts->start_pts, PT_COMP, "Computer 3"); - } + + for (int i = 0; i < match_opts->num_players; ++i) + match_add_player(match_opts->start_pts, + match_opts->players[i].type, + match_opts->players[i].name); scoreboard_show_info(match_num_players()); for (int i = 1; i <= match_num_players(); ++i) { -- cgit v1.2.3-70-g09d2