summaryrefslogtreecommitdiff
path: root/web/web_match.c
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-05-09 23:39:12 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-05-09 23:39:12 -0700
commit90b5ca5e47f0fda21f8da6cb9857a35e0f4730a3 (patch)
tree05c3bae5829fcdcc5df2bebd36c504efea974494 /web/web_match.c
parent1def0d71449f95c1fb609053b84a92e8adbb0eb1 (diff)
downloaddartboat-90b5ca5e47f0fda21f8da6cb9857a35e0f4730a3.tar.gz
dartboat-90b5ca5e47f0fda21f8da6cb9857a35e0f4730a3.tar.xz
web: allow selection of starting points and user to throw first
This new option selection code is a bit messy for now. It requires the options and their order to be in sync between the prompt functions and the corresponding submit functions. There's also a bit too much repetition of generic code that's applicable to all options.
Diffstat (limited to 'web/web_match.c')
-rw-r--r--web/web_match.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/web/web_match.c b/web/web_match.c
index 5f87f28..d05efa5 100644
--- a/web/web_match.c
+++ b/web/web_match.c
@@ -4,6 +4,7 @@
#include <stdlib.h>
struct match_state *state;
+struct match_opts *match_opts;
void free_state()
{
@@ -14,6 +15,12 @@ void free_state()
state = NULL;
}
+void match_opts_free()
+{
+ free(match_opts);
+ match_opts = NULL;
+}
+
bool match_is_over()
{
return state->legs[0]->rem <= 0 || state->legs[1]->rem <= 0;