summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rules.js19
1 files changed, 6 insertions, 13 deletions
diff --git a/rules.js b/rules.js
index 5f0cc3e..2a80a34 100644
--- a/rules.js
+++ b/rules.js
@@ -1227,11 +1227,8 @@ function trace_supply_highway(here, d) {
supply_visited[here] = 0
- if (has_supply) {
+ if (has_supply)
supply_net[here] = 1
- if (supply_enemy[here] <= 1)
- supply_src[here] = 1
- }
return has_supply
}
@@ -1321,17 +1318,13 @@ function trace_supply_chain(here, d, n, range) {
supply_visited[here] = 0
- if (has_supply) {
+ if (has_supply)
supply_net[here] = 1
- // undisrupted units can chain supply
- if (supply_friendly[here] > 1 && supply_enemy[here] <= 1)
- supply_src[here] = 1
- }
return has_supply
}
-function trace_supply_network(start, ss) {
+function trace_supply_network(start) {
supply_visited.fill(0)
supply_src.fill(0)
supply_net.fill(0)
@@ -1408,13 +1401,13 @@ function can_trace_supply_to_base_or_fortress(base, from) {
function update_axis_supply() {
supply_axis_invalid = false
init_trace_supply(supply_axis_network, supply_axis_line, AXIS)
- trace_supply_network(EL_AGHEILA, 0)
+ trace_supply_network(EL_AGHEILA)
}
function update_allied_supply() {
supply_allied_invalid = false
init_trace_supply(supply_allied_network, supply_allied_line, ALLIED)
- trace_supply_network(ALEXANDRIA, 0)
+ trace_supply_network(ALEXANDRIA)
}
function update_bardia_supply() {
@@ -1496,7 +1489,7 @@ function tobruk_supply_network() {
}
function unit_supply_line(who) {
- // override with saved supply line during withdrawal regroup moves
+ // Use saved supply line during withdrawal regroup moves.
if (is_active_player() && game.withdraw && game.withdraw.supply_line) {
switch (unit_supply(who)) {
case SS_BARDIA: return game.withdraw.bardia_line