summaryrefslogtreecommitdiff
path: root/web/web_control.c
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-05-04 11:08:23 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-05-04 11:08:23 -0700
commita28369258b89e013103edcca20355eb61fffdf69 (patch)
treee514c8804fcdb5f282a012d8e8931b057585aba0 /web/web_control.c
parent3492c24cc533e9088e8b12f929f5d922c8787cba (diff)
downloaddartboat-a28369258b89e013103edcca20355eb61fffdf69.tar.gz
dartboat-a28369258b89e013103edcca20355eb61fffdf69.tar.xz
formatting
Diffstat (limited to 'web/web_control.c')
-rw-r--r--web/web_control.c16
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;
}