summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-05-20 22:27:01 +0200
committerTor Andersson <tor@ccxvii.net>2023-05-20 22:27:01 +0200
commit25f0a50c8bc6dc028d0c0497e71d515576bdd211 (patch)
treee94d312217594af5139bbcdb066fadb91aab876b
parent712fdea3e8e8694996db89eff462018a11b2a133 (diff)
downloadwilderness-war-25f0a50c8bc6dc028d0c0497e71d515576bdd211.tar.gz
Fix crash when activating 0 leaders/units individually.
-rw-r--r--rules.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/rules.js b/rules.js
index 6ddbb46..a4e9934 100644
--- a/rules.js
+++ b/rules.js
@@ -2494,8 +2494,12 @@ function goto_pick_first_move() {
logbr()
log("Selected\n" + game.activation.map(log_piece_name_and_place).join(",\n") + ".")
game.state = 'pick_move'
- } else {
+ } else if (game.activation.length > 0) {
goto_move_piece(game.activation.pop())
+ } else {
+ delete game.activation_value
+ delete game.activation
+ end_action_phase()
}
}