summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-09-15 03:27:51 +0200
committerTor Andersson <tor@ccxvii.net>2024-09-15 10:18:57 +0200
commit6e23b26f70f68c686e9f65af29bc35792b76938e (patch)
tree9670e9036c7c1de62585402b8e29f071c12ae598 /rules.js
parentb8aa47d94217df96ecf279151eca7b24d5206e77 (diff)
downloadrommel-in-the-desert-6e23b26f70f68c686e9f65af29bc35792b76938e.tar.gz
Use only own supply line when forced march is used to withdraw.HEADmaster
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js9
1 files 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)