summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-05-10 00:05:04 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-05-10 00:05:04 -0700
commitcf7b5519c257c96f426edf045b07e29e8aeb4e72 (patch)
treefdee104dcce6dc6745f514fb944d051abfb71765
parent90b5ca5e47f0fda21f8da6cb9857a35e0f4730a3 (diff)
downloaddartboat-cf7b5519c257c96f426edf045b07e29e8aeb4e72.tar.gz
dartboat-cf7b5519c257c96f426edf045b07e29e8aeb4e72.tar.xz
web: fix post-match undo when bot is throwing second
-rw-r--r--web/web_control.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/web/web_control.c b/web/web_control.c
index 2890308..4495d51 100644
--- a/web/web_control.c
+++ b/web/web_control.c
@@ -200,7 +200,11 @@ void user_undo()
l->rem += v->points;
memset(v, 0, sizeof(*v));
- if (state->mode == M_PVC && state->legs[1]->n_visits > l->n_visits) {
+ if (state->mode == M_PVC &&
+ ((match_opts->throws_first == 1 &&
+ state->legs[1]->n_visits > l->n_visits) ||
+ (match_opts->throws_first == 2 &&
+ state->legs[1]->n_visits > l->n_visits + 1))) {
struct leg *bl = state->legs[1];
bl->rem += bl->visits[--bl->n_visits].points;
++state->boat_undone;