summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/static/sw.js2
-rw-r--r--web/web_control.c7
-rw-r--r--web/web_scoreboard.c6
3 files changed, 8 insertions, 7 deletions
diff --git a/web/static/sw.js b/web/static/sw.js
index 56f5626..5760aaf 100644
--- a/web/static/sw.js
+++ b/web/static/sw.js
@@ -1,5 +1,5 @@
const CACHE_PREFIX = 'dartboat-'
-const CACHE_VERSION = '22';
+const CACHE_VERSION = '23';
const CACHE_NAME = `${CACHE_PREFIX}${CACHE_VERSION}`;
const CACHE_FILES = [
diff --git a/web/web_control.c b/web/web_control.c
index d06e17e..96c455e 100644
--- a/web/web_control.c
+++ b/web/web_control.c
@@ -135,7 +135,7 @@ void handle_next()
if (state->m->active_player)
set_active_player(match_next_player(state->m));
else
- set_active_player(match_opts->throws_first);
+ set_active_player(state->m->starting_player);
if (match_player_is_comp(state->m->active_player))
boat_visit();
@@ -181,7 +181,7 @@ static void undo_active()
update_player_avg(state->m->active_player, 0);
update_player_rem(state->m->active_player, l->rem);
- state->m->active_player = match_last_player_to_throw(state->m);
+ state->m->active_player = match_prev_throw_player(state->m);
}
void user_undo()
@@ -202,7 +202,7 @@ void user_undo()
return;
}
- state->m->active_player = match_last_player_to_throw(state->m);
+ state->m->active_player = match_prev_throw_player(state->m);
while (match_player_is_comp(state->m->active_player))
undo_active();
undo_active();
@@ -233,6 +233,7 @@ void start_match()
match_opts->players[i].type,
match_opts->players[i].name,
match_opts->start_pts);
+ state->m->starting_player = match_opts->throws_first;
scoreboard_show_info(state->m->n_players);
for (int i = 1; i <= state->m->n_players; ++i) {
diff --git a/web/web_scoreboard.c b/web/web_scoreboard.c
index 907b1e5..657c326 100644
--- a/web/web_scoreboard.c
+++ b/web/web_scoreboard.c
@@ -306,7 +306,7 @@ void draw_visits_dense()
elemv[elemc++] = create_div("0", "visit-n");
for (int i = 0; i < np; ++i) {
- if (i + 1 == match_opts->throws_first)
+ if (i + 1 == state->m->starting_player)
elemv[elemc++] = create_div("", "throws-first");
else
elemv[elemc++] = create_div("", "");
@@ -404,7 +404,7 @@ void draw_visits()
char buf[32], buf2[32];
snprintf(buf, sizeof(buf), "%d", state->m->legs[0]->start);
- if (match_opts->throws_first == 1)
+ if (state->m->starting_player == 1)
elemv[elemc++] = create_div("", // content added via CSS
"visit-p1-pts throws-first");
elemv[elemc++] = create_div(buf, "visit-p1-rem");
@@ -412,7 +412,7 @@ void draw_visits()
if (state->m->n_players != 1) {
snprintf(buf, sizeof(buf), "%d", state->m->legs[1]->start);
elemv[elemc++] = create_div(buf, "visit-p2-rem");
- if (match_opts->throws_first == 2)
+ if (state->m->starting_player == 2)
elemv[elemc++] = create_div("",
"visit-p2-pts throws-first");
}