diff options
Diffstat (limited to 'web/dartboat_wasm.c')
-rw-r--r-- | web/dartboat_wasm.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/web/dartboat_wasm.c b/web/dartboat_wasm.c index 5aa38bc..ceed714 100644 --- a/web/dartboat_wasm.c +++ b/web/dartboat_wasm.c @@ -8,8 +8,9 @@ #include <emscripten/emscripten.h> -#define M_PVC 1 +#define M_P 1 #define M_PVP 2 +#define M_PVC 3 int delay_ms = 1000; @@ -255,7 +256,7 @@ EMSCRIPTEN_KEEPALIVE bool user_visit(int points) { if (state->mode == M_PVC) { set_boat_active(); boat_visit(); - } else { + } else if (state->mode == M_PVP) { switch_active_user(); } } @@ -368,7 +369,7 @@ EMSCRIPTEN_KEEPALIVE void free_match() { } EMSCRIPTEN_KEEPALIVE void start_match(int mode) { - if (mode != M_PVP && mode != M_PVC) { + if (mode != M_PVP && mode != M_PVC && mode != M_P) { EM_ASM(oi()); return; } @@ -385,6 +386,10 @@ EMSCRIPTEN_KEEPALIVE void start_match(int mode) { state->l1 = leg_init(501, "Player 1"); state->l2 = leg_init(501, "Player 2"); } + if (mode == M_P) + EM_ASM(hidePlayer2()); + else + EM_ASM(unhidePlayer2()); state->active_p = 1; state->active_l = state->l1; |