summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-07-13 18:03:37 +0200
committerTor Andersson <tor@ccxvii.net>2023-07-13 18:03:37 +0200
commit25354888d43bdb340e9a277b6a45dadd7c6f2d19 (patch)
tree4073ae6f157883469ffd9376c92c1faba2539318
parent5f08c1b4c66b873b9a8df43f5dcaad0d14d72583 (diff)
downloadrommel-in-the-desert-25354888d43bdb340e9a277b6a45dadd7c6f2d19.tar.gz
Optimize own supply line search.
-rw-r--r--rules.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/rules.js b/rules.js
index 316d2ac..686dcdb 100644
--- a/rules.js
+++ b/rules.js
@@ -1591,6 +1591,10 @@ function search_own_supply_line_rec(path, here, ssrc, sline, sdist) {
let side = to_side(here, next, s)
+ // must move closer (because we only search supply line for withdrawal purposes)
+ if (sdist[next] > sdist[here] && side !== BARDIA_FT_CAPUZZO)
+ continue
+
// must follow supply line
if (sline[side] === 0)
continue