From 469e8da541659ad0606ed214d496361f36f175e6 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 30 Oct 2023 12:51:25 +0100 Subject: Only allow quick setup as first action. ... abuse the undo stack to check this instead of a temporary state attribute. --- rules.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/rules.js b/rules.js index 39456b6..f300312 100644 --- a/rules.js +++ b/rules.js @@ -1547,7 +1547,9 @@ states.scenario_setup = { }) if (current_player_quick_setup()) { - view.actions.quick_setup = !game.quick_setup + // only allow quick-setup as the very first action + if (game.undo.length === 0) + view.actions.quick_setup = 1 } } else { // subsequent units must be on the same map location (or also on DEPLOY) @@ -1592,7 +1594,6 @@ states.scenario_setup = { log("Loading quick setup") let deployment = current_player_quick_setup() setup_units(deployment) - game.quick_setup = true }, unit(u) { set_toggle(game.selected, u) @@ -1610,7 +1611,6 @@ states.scenario_setup = { for (let u of list) { deploy_unit(u, to) } - delete game.quick_setup }, end_deployment() { log(`Deployed`) @@ -1621,7 +1621,6 @@ states.scenario_setup = { logi(`${game.summary[x]} at A${x}`) } game.summary = null - delete game.quick_setup end_scenario_setup() } -- cgit v1.2.3