From 6e23b26f70f68c686e9f65af29bc35792b76938e Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 15 Sep 2024 03:27:51 +0200 Subject: Use only own supply line when forced march is used to withdraw. --- rules.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rules.js b/rules.js index 3c06ac6..b3e1385 100644 --- a/rules.js +++ b/rules.js @@ -894,7 +894,7 @@ function for_each_adjacent_hex(here, fn) { for (let s = 0; s < 6; ++s) { let next = here + hexnext[s] if (is_map_hex(next)) - fn(next) + fn(next, to_side(here, next, s)) } } @@ -4020,9 +4020,14 @@ function move_via(who, to, speed, move) { forced: [], move: move } - for_each_adjacent_hex(to, via => { + for_each_adjacent_hex(to, (via, side) => { let forced = false let unforced = false + + if (game.turn_option === 'pass') + if (!own_supply_line[side]) + return + function check_road(bonus) { if (hex_road[from] >= bonus) { let k = can_move_via(via, to, speed, bonus) -- cgit v1.2.3