diff options
Diffstat (limited to 'web/web_match.c')
-rw-r--r-- | web/web_match.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/web/web_match.c b/web/web_match.c index 0ebc56e..cd87c5a 100644 --- a/web/web_match.c +++ b/web/web_match.c @@ -60,6 +60,7 @@ void match_opts_new() if (match_opts) match_opts_free(); match_opts = calloc(1, sizeof(*match_opts)); + match_opts->start_pts = 501; match_opts->size_players = 2; match_opts->players = malloc( @@ -77,8 +78,12 @@ void match_opts_add_player(enum player_type type, char *name) sizeof(*(match_opts->players))); } - match_opts->players[match_opts->num_players].type = type; - match_opts->players[match_opts->num_players++].name = name; + int pn = ++match_opts->num_players; + if (!match_opts->throws_first) + match_opts->throws_first = pn; + + match_opts->players[pn - 1].type = type; + match_opts->players[pn - 1].name = name; } void match_opts_free() |