summaryrefslogtreecommitdiff
path: root/web/web_control.c
diff options
context:
space:
mode:
Diffstat (limited to 'web/web_control.c')
-rw-r--r--web/web_control.c15
1 files changed, 5 insertions, 10 deletions
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) {