diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-04-24 19:55:59 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-04-24 19:56:49 -0700 |
commit | edd8d573f3d212ec76db8b5e77de5aadbe31d90a (patch) | |
tree | eb85e67a3cfdd2780e2323f1a1eba386885b5876 /web | |
parent | a7e4bbf9e79715d5a0f1a62b5b89d77e4bd3dbd1 (diff) | |
download | dartboat-edd8d573f3d212ec76db8b5e77de5aadbe31d90a.tar.gz dartboat-edd8d573f3d212ec76db8b5e77de5aadbe31d90a.tar.xz |
web: error on negative visit score
Diffstat (limited to 'web')
-rw-r--r-- | web/dartboat_wasm.c | 3 |
1 files changed, 1 insertions, 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); } |