From c056da9a84d5e2964e2ebc99f3cc68f074d92190 Mon Sep 17 00:00:00 2001 From: mamoniot Date: Fri, 16 Dec 2022 12:37:55 -0500 Subject: [PATCH 1/2] prepared for next version --- cybersyn/changelog.txt | 5 +++++ cybersyn/info.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cybersyn/changelog.txt b/cybersyn/changelog.txt index 8d28481..617e15e 100644 --- a/cybersyn/changelog.txt +++ b/cybersyn/changelog.txt @@ -1,4 +1,9 @@ --------------------------------------------------------------------------------------------------- +Version: 1.1.6 +Date: 2022-12-16 + Changes: + - None +--------------------------------------------------------------------------------------------------- Version: 1.1.5 Date: 2022-12-16 Changes: diff --git a/cybersyn/info.json b/cybersyn/info.json index c3754a0..91518b3 100644 --- a/cybersyn/info.json +++ b/cybersyn/info.json @@ -1,6 +1,6 @@ { "name": "cybersyn", - "version": "1.1.5", + "version": "1.1.6", "title": "Project Cybersyn", "author": "Mami", "factorio_version": "1.1", From b353b0b5866f5d781525d77de93c6f4b015f138d Mon Sep 17 00:00:00 2001 From: mamoniot Date: Fri, 16 Dec 2022 19:01:18 -0500 Subject: [PATCH 2/2] fixed a crash --- cybersyn/changelog.txt | 2 +- cybersyn/scripts/central-planning.lua | 2 +- cybersyn/scripts/factorio-api.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cybersyn/changelog.txt b/cybersyn/changelog.txt index 617e15e..d26cafe 100644 --- a/cybersyn/changelog.txt +++ b/cybersyn/changelog.txt @@ -2,7 +2,7 @@ Version: 1.1.6 Date: 2022-12-16 Changes: - - None + - Fixed a crash relating to per-item request thresholds --------------------------------------------------------------------------------------------------- Version: 1.1.5 Date: 2022-12-16 diff --git a/cybersyn/scripts/central-planning.lua b/cybersyn/scripts/central-planning.lua index a8e49ec..87ab317 100644 --- a/cybersyn/scripts/central-planning.lua +++ b/cybersyn/scripts/central-planning.lua @@ -340,7 +340,7 @@ local function tick_dispatch(map_data, mod_settings) if effective_count >= r_threshold then local item_threshold = p_station.item_thresholds and p_station.item_thresholds[item_name] or nil local prior = p_station.priority - if item_threshold then + if item_threshold and p_station.item_priority then prior = p_station.item_priority--[[@as int]] end local slot_threshold = item_type == "fluid" and r_threshold or ceil(r_threshold/get_stack_size(map_data, item_name)) diff --git a/cybersyn/scripts/factorio-api.lua b/cybersyn/scripts/factorio-api.lua index 21e10f7..a982a0f 100644 --- a/cybersyn/scripts/factorio-api.lua +++ b/cybersyn/scripts/factorio-api.lua @@ -19,7 +19,7 @@ end function get_stop_dist(entity0, entity1) local surface0 = entity0.surface.index local surface1 = entity1.surface.index - return (surface0 == surface1 and get_distance(entity0.position, entity1.position) or DIFFERENT_SURFACE_DISTANCE) + return (surface0 == surface1 and get_distance(entity0.position, entity1.position) or DIFFERENT_SURFACE_DISTANCE)--[[@as number]] end