summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)