summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-11-05 19:57:20 +0100
committerTor Andersson <tor@ccxvii.net>2024-11-06 01:45:34 +0100
commitc4f5d9bb3e550ba8d13725cc1aeb0da2b27274b2 (patch)
treedd37649a37843c4ed80c1cbcc147de6ef4cc93b8 /rules.js
parent102b08d2b01959992d1e39b58d13386b9c458ea6 (diff)
downloadmaria-c4f5d9bb3e550ba8d13725cc1aeb0da2b27274b2.tar.gz
Hussars can be placed 4 from general on Flanders map across the divide.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js17
1 files changed, 4 insertions, 13 deletions
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)