diff options
Diffstat (limited to 'web/web_control.c')
-rw-r--r-- | web/web_control.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/web/web_control.c b/web/web_control.c index e1e322d..5bf3c7d 100644 --- a/web/web_control.c +++ b/web/web_control.c @@ -105,8 +105,9 @@ void boat_visit() char *tmp = malloc(len_str + 1); // free in draw_boat_throwing memcpy(tmp, str, len_str + 1); - EM_ASM({scheduleCCall($0, $1, $2, $3, $4, $5)}, "draw_boat_throwing", - delay_ms * (i+1), pts, tmp, c.x, c.y); + EM_ASM({scheduleCCall($0, $1, $2, $3, $4, $5)}, + "draw_boat_throwing", delay_ms * (i+1), + pts, tmp, c.x, c.y); } EM_ASM({scheduleCCall($0, $1, $2, $3)}, "end_boat_visit", @@ -181,11 +182,10 @@ void user_undo() if (state->num_darts) { state->num_darts = 0; + struct leg *l = state->active_leg; scoreboard_set_player_avg(state->active_player, - ((double)(state->active_leg->start - - state->active_leg->visits[ - state->active_leg->n_visits-2].rem) / - (state->active_leg->n_visits-1))); + ((double)(l->start - l->visits[l->n_visits-2].rem) / + (l->n_visits - 1))); scoreboard_set_player_active(state->active_player); handle_next(); return; @@ -206,8 +206,8 @@ void user_undo() memcpy(v, 0, sizeof(*v)); if (state->mode == M_PVC && state->legs[1]->n_visits > l->n_visits) { - state->legs[1]->rem += - state->legs[1]->visits[--state->legs[1]->n_visits].points; + struct leg *bl = state->legs[1]; + bl->rem += bl->visits[--bl->n_visits].points; ++state->boat_undone; } |