From a28369258b89e013103edcca20355eb61fffdf69 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Wed, 4 May 2022 11:08:23 -0700 Subject: formatting --- web/web_control.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'web/web_control.c') 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; } -- cgit v1.2.3-70-g09d2