summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-03-11 03:22:53 +0100
committerTor Andersson <tor@ccxvii.net>2024-03-11 03:23:11 +0100
commit441c2ff4658312371f70a4ddc768ac13834d4be8 (patch)
treed9f679a2305ea8ac3d56757cb3da392153894700
parent6156f457c10e988fafb0f6acb776ddc6dc21ed0d (diff)
downloadrommel-in-the-desert-441c2ff4658312371f70a4ddc768ac13834d4be8.tar.gz
Also put hexes where supply lines stop in the search order list.
-rw-r--r--rules.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/rules.js b/rules.js
index 8efe01b..f6f40ce 100644
--- a/rules.js
+++ b/rules.js
@@ -1228,9 +1228,6 @@ function trace_supply_network_1(start)
let here = item >> 3
let here_move = item & 7
- if (supply_friendly[here] > 0)
- search_order.unshift(here)
-
for (let s = 0; s < 6; ++s) {
let next = here + hexnext[s]
@@ -1258,6 +1255,9 @@ function trace_supply_network_1(start)
supply_visited[next] = next_move
+ if (supply_friendly[next] > 0 && !supply_net[next])
+ search_order.unshift(next)
+
supply_net[next] = 1
if (next_move !== TRACE_STOP)