summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-11-11 11:09:52 +0100
committerTor Andersson <tor@ccxvii.net>2024-11-11 11:09:52 +0100
commit839ab1eec84287f78a8068fee8d3d42e258a53c3 (patch)
tree4694862a1cf6093f16d7ae899ac9ba69ab745493
parent2d091994e2e47ef540d464719caef557895d0952 (diff)
downloadmaria-839ab1eec84287f78a8068fee8d3d42e258a53c3.tar.gz
fix hussar search when generals eliminated
-rw-r--r--rules.js5
1 files changed, 3 insertions, 2 deletions
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"