From 5cf699902c6f1a37175380f050ecc7456aaaff41 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 24 May 2024 22:03:58 +0200 Subject: test detach by clicking directly only --- rules.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/rules.js b/rules.js index 64ae5ab..b71803e 100644 --- a/rules.js +++ b/rules.js @@ -1645,10 +1645,17 @@ states.move_general_OLD = { let here = game.pos[who] if (game.count === 0) { + /* if (game.selected.length > 1) view.actions.detach = 1 else view.actions.detach = 0 + */ + + // detach + if (game.selected.length > 1) + for (let p of game.selected) + gen_action_piece(p) let s_take = count_stacked_take() let s_give = count_stacked_give() @@ -1684,10 +1691,14 @@ states.move_general_OLD = { game.state = "move_detach" }, piece(p) { - if (p === game.selected[0]) - this.stop() - else - this.space(game.pos[p]) + if (game.count === 0) { + set_delete(game.selected, p) + } else { + if (p === game.selected[0]) + this.stop() + else + this.space(game.pos[p]) + } }, stop() { for (let p of game.selected) -- cgit v1.2.3