From edd8d573f3d212ec76db8b5e77de5aadbe31d90a Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Sun, 24 Apr 2022 19:55:59 -0700 Subject: web: error on negative visit score --- web/dartboat_wasm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/web/dartboat_wasm.c b/web/dartboat_wasm.c index 78538b5..6bbb97a 100644 --- a/web/dartboat_wasm.c +++ b/web/dartboat_wasm.c @@ -218,7 +218,7 @@ EMSCRIPTEN_KEEPALIVE void boat_visit() { } EMSCRIPTEN_KEEPALIVE bool user_visit(int points) { - if (state->l1->rem <= 0 || state->l2->rem <= 0 || + if (points < 0 || state->l1->rem <= 0 || state->l2->rem <= 0 || points > state->active_l->rem || state->active_l->rem - points == 1 || points > 180 || points == 179 || points == 178 || points == 176 || points == 175 || points == 173 || points == 172 || points == 169 || @@ -256,7 +256,6 @@ EMSCRIPTEN_KEEPALIVE bool user_visit(int points) { return true; } -// FIXME neg EMSCRIPTEN_KEEPALIVE void user_visit_to_rem(int rem) { user_visit(state->l1->rem - rem); } -- cgit v1.2.3-70-g09d2