summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/rules.js b/rules.js
index 5461392..ab7b143 100644
--- a/rules.js
+++ b/rules.js
@@ -2202,6 +2202,17 @@ function search_retreat_distance(from, range) {
return seen
}
+function is_illegal_cross_map_retreat(from, to) {
+ if ((is_flanders_space(from) && is_bohemia_space(to)) || (is_flanders_space(to) && is_bohemia_space(from))) {
+ for (let p of game.selected) {
+ let pow = piece_power[p]
+ if (pow !== P_FRANCE && pow !== P_AUSTRIA)
+ return true
+ }
+ }
+ return false
+}
+
// search all possible retreat paths of given length
function search_retreat_possible_dfs(result, seen, here, range) {
for (let next of data.cities.adjacent[here]) {
@@ -2209,6 +2220,8 @@ function search_retreat_possible_dfs(result, seen, here, range) {
continue
if (has_any_piece(next))
continue
+ if (is_illegal_cross_map_retreat(here, next))
+ continue
if (range === 1) {
set_add(result, next)
} else {