From c4f5d9bb3e550ba8d13725cc1aeb0da2b27274b2 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 5 Nov 2024 19:57:20 +0100 Subject: Hussars can be placed 4 from general on Flanders map across the divide. --- rules.js | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index 1ec17ab..2402b3a 100644 --- a/rules.js +++ b/rules.js @@ -1579,16 +1579,9 @@ states.place_hussars_where = { prompt() { prompt("Place the hussar in a city.") view.selected = game.selected - - // bohemia - // within 4 of an austrian general - // not occupied by any piece - for (let p of all_power_generals[P_AUSTRIA]) { - let s = game.pos[p] - if (is_bohemia_space(s)) - for (let x of search_hussar_bfs(s)) - gen_action_space(x) - } + for (let p of all_power_generals[P_AUSTRIA]) + for (let x of search_hussar_bfs(game.pos[p])) + gen_action_space(x) }, space(to) { game.state = "place_hussars" @@ -1607,9 +1600,7 @@ function search_hussar_bfs(from) { for (let next of data.cities.adjacent[here]) { if (set_has(seen, next)) continue - if (!is_bohemia_space(next)) - continue - if (!has_any_piece(next) && !has_any_hussar(next)) + if (is_bohemia_space(next) && !has_any_piece(next) && !has_any_hussar(next)) set_add(seen, next) if (dist < 4) queue.push((next << 4) | dist) -- cgit v1.2.3