diff options
Diffstat (limited to 'web/web_scoreboard.c')
-rw-r--r-- | web/web_scoreboard.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/web/web_scoreboard.c b/web/web_scoreboard.c index 657c326..35af7f4 100644 --- a/web/web_scoreboard.c +++ b/web/web_scoreboard.c @@ -176,18 +176,9 @@ void update_player_name(int pn, char *str) void update_player_sugg(int pn, int rem) { - char str[15] = {0}, *p = str; - - if (rem > 1 && rem <= 170) { - char *target; - int i = 3, trem = rem; - while (i && trem && (target = CHECKOUTS[--i][trem-1])) { - p += sprintf(p, i == 2 ? "%s" : "-%s", target); - trem -= segment_points(segment_from_name(target)); - } - } - - scoreboard_set_player_sugg(pn, str); + char *sugg = checkouts_suggested(rem); + scoreboard_set_player_sugg(pn, sugg ? sugg : ""); + free(sugg); } static double calc_avg(struct leg *l, int n_darts) { |