summaryrefslogtreecommitdiff
path: root/web/web_scoreboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'web/web_scoreboard.c')
-rw-r--r--web/web_scoreboard.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/web/web_scoreboard.c b/web/web_scoreboard.c
index 7dc4b8e..769d68e 100644
--- a/web/web_scoreboard.c
+++ b/web/web_scoreboard.c
@@ -227,15 +227,15 @@ void scoreboard_show_info(int num_players)
if (bufs) free(bufs);
bufs = calloc(num_players, sizeof(*bufs));
- set_slot_player(1, 1);
- dom_add_class("#info-slot-1 .inner", "visible");
+ for (int i = 1; i <= num_players && i <= NUM_SLOTS; ++i) {
+ set_slot_player(i, i);
- if (num_players > 1) {
- set_slot_player(2, 2);
- dom_add_class("#info-slot-2 .inner", "visible");
+ char buf[64];
+ sprintf(buf, "#info-slot-%d .inner", i);
+ dom_add_class(buf, "visible");
}
- if (num_players > 2) {
+ if (num_players > NUM_SLOTS) {
dom_add_class("#info-slot-prev", "visible");
dom_add_class("#info-slot-next", "visible");
}