summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-01-04 12:52:10 +0100
committerTor Andersson <tor@ccxvii.net>2023-02-18 13:02:38 +0100
commitceaa1d86746b5b10048f286dc953d5817c3384d7 (patch)
tree0e2858a6063edc8e9a93dca4990e1015791c84d9
parente6a5ac3e558ad6129ac293f2780119b7bd26a6d3 (diff)
downloadnevsky-ceaa1d86746b5b10048f286dc953d5817c3384d7.tar.gz
WIP supply opt
-rw-r--r--rules.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/rules.js b/rules.js
index 8a87718..7c1661b 100644
--- a/rules.js
+++ b/rules.js
@@ -594,7 +594,7 @@ function set_lord_locale(lord, locale) {
}
function shift_lord_cylinder(lord, dir) {
- set_lord_locale(lord, get_lord_locale(lord) + dir)
+ set_lord_calendar(lord, get_lord_calendar(lord) + dir)
}
function set_lord_service(lord, service) {
@@ -5123,9 +5123,12 @@ function list_supply_sources(ships) {
let _supply_stat = 0
let _supply_stop = new Array(last_locale+1)
-let _supply_seen = new Array(last_locale+1)
let _supply_reached = new Array(last_locale+1)
+let _supply_seen = new Array(last_locale+1)
+let _supply_boats = new Array(last_locale+1)
+let _supply_carts = new Array(last_locale+1)
+
function filter_reachable_supply_sources(sources, boats, carts, sleds) {
_supply_stat = 0
_supply_stop.fill(0)
@@ -5144,6 +5147,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)
search_supply_reachable_summer(sources, get_lord_locale(game.command), boats, carts)
break
case EARLY_WINTER: