diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-05-24 22:03:58 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-05-30 21:59:25 +0200 |
commit | 5cf699902c6f1a37175380f050ecc7456aaaff41 (patch) | |
tree | cd7a0586fa3ccfd6bd1f28397aa98658d9d993d0 | |
parent | 6f5be691ae545b8e85ca9549bb8eddb23f567ba2 (diff) | |
download | friedrich-5cf699902c6f1a37175380f050ecc7456aaaff41.tar.gz |
test detach by clicking directly only
-rw-r--r-- | rules.js | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -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) |