summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2025-01-29 12:50:33 +0100
committerTor Andersson <tor@ccxvii.net>2025-01-29 12:50:33 +0100
commit824a97661b0a634fd03c3ba3cd34ae56daf25c97 (patch)
tree5e17a0ad9d4994a63460d33ddd3b85ecbf9b6ca0 /rules.js
parent96a91ed29eb0901b4f88f2b0c1a7fc9c807c066d (diff)
downloadmaria-824a97661b0a634fd03c3ba3cd34ae56daf25c97.tar.gz
fix retreats into neutral spaces
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/rules.js b/rules.js
index 7f00c51..639ff2d 100644
--- a/rules.js
+++ b/rules.js
@@ -4262,11 +4262,14 @@ function is_illegal_cross_map_retreat(from, to) {
// search all possible retreat paths of given length
function search_retreat_possible_dfs(result, seen, here, range) {
+ let pow = piece_power[game.selected[0]]
for (let next of data.cities.adjacent[here]) {
if (seen.includes(next))
continue
if (has_any_piece(next))
continue
+ if (is_forbidden_neutral_space(pow, next))
+ continue
if (is_illegal_cross_map_retreat(here, next))
continue
if (range === 1) {