From 839ab1eec84287f78a8068fee8d3d42e258a53c3 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 11 Nov 2024 11:09:52 +0100 Subject: fix hussar search when generals eliminated --- rules.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index 7ba0ed9..6078ef4 100644 --- a/rules.js +++ b/rules.js @@ -1599,8 +1599,9 @@ states.place_hussars_where = { prompt("Place the hussar in a city.") view.selected = game.selected for (let p of all_power_generals[P_AUSTRIA]) - for (let x of search_hussar_bfs(game.pos[p])) - gen_action_space(x) + if (is_piece_on_map(p)) + for (let x of search_hussar_bfs(game.pos[p])) + gen_action_space(x) }, space(to) { game.state = "place_hussars" -- cgit v1.2.3