From 25f0a50c8bc6dc028d0c0497e71d515576bdd211 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 20 May 2023 22:27:01 +0200 Subject: Fix crash when activating 0 leaders/units individually. --- rules.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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() } } -- cgit v1.2.3