summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-01-05 22:43:38 +0100
committerTor Andersson <tor@ccxvii.net>2023-02-18 13:02:38 +0100
commit3fe2e98879c1f5b84916ab28c767e63ec8a89829 (patch)
treed80f20e9bfeca3db687141a58784d03a293f21fc
parentc2a06cbf599f93fb6c576978159907cca0de25de (diff)
downloadnevsky-3fe2e98879c1f5b84916ab28c767e63ec8a89829.tar.gz
Fix supply optimization end of the world bug.
-rw-r--r--rules.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/rules.js b/rules.js
index 74ce69d..09c040a 100644
--- a/rules.js
+++ b/rules.js
@@ -5267,8 +5267,8 @@ function filter_reachable_supply_sources(sources, boats, carts, sleds) {
switch (current_season()) {
case SUMMER:
_supply_seen.fill(0)
- _supply_boats.fill(0)
- _supply_carts.fill(0)
+ _supply_boats.fill(-1)
+ _supply_carts.fill(-1)
search_supply_reachable_summer(get_lord_locale(game.command), boats, carts)
break
case EARLY_WINTER:
@@ -5284,13 +5284,12 @@ function filter_reachable_supply_sources(sources, boats, carts, sleds) {
for (let here of sources)
if (_supply_reached[here])
set_add(result, here)
- console.log("SUPPLY SEARCH", _supply_stat, sources.join(","), result.join(","), _supply_reached.join(""))
+ console.log("SUPPLY SEARCH", _supply_stat, sources, result, _supply_reached.join(""))
return result
}
function search_supply_reachable_summer(here, boats, carts) {
// Been here before with same or more transports remaining
- //if (_supply_boats[here] >= boats && _supply_carts[here] >= carts)
if (_supply_boats[here] >= boats && _supply_carts[here] >= carts)
return