diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-11-05 19:57:20 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-11-06 01:45:34 +0100 |
commit | c4f5d9bb3e550ba8d13725cc1aeb0da2b27274b2 (patch) | |
tree | dd37649a37843c4ed80c1cbcc147de6ef4cc93b8 | |
parent | 102b08d2b01959992d1e39b58d13386b9c458ea6 (diff) | |
download | maria-c4f5d9bb3e550ba8d13725cc1aeb0da2b27274b2.tar.gz |
Hussars can be placed 4 from general on Flanders map across the divide.
-rw-r--r-- | rules.js | 17 |
1 files changed, 4 insertions, 13 deletions
@@ -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) |