summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-10-30 12:51:25 +0100
committerTor Andersson <tor@ccxvii.net>2023-10-30 12:52:47 +0100
commit469e8da541659ad0606ed214d496361f36f175e6 (patch)
treea8b9896cb97f63060ad8447e0435d00d9a2d65a7
parente2f4af7e507a37593c6227ee2129df4682806e74 (diff)
downloadalgeria-469e8da541659ad0606ed214d496361f36f175e6.tar.gz
Only allow quick setup as first action.
... abuse the undo stack to check this instead of a temporary state attribute.
-rw-r--r--rules.js7
1 files 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()
}