From f82243e7e8062e11460c7a7a4a4a7d7b4754e7e2 Mon Sep 17 00:00:00 2001 From: mamoniot Date: Mon, 1 May 2023 06:50:08 -0400 Subject: [PATCH 1/5] fixed typos --- cybersyn/scripts/factorio-api.lua | 2 +- cybersyn/scripts/main.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cybersyn/scripts/factorio-api.lua b/cybersyn/scripts/factorio-api.lua index a34109e7..cf78fc0b 100644 --- a/cybersyn/scripts/factorio-api.lua +++ b/cybersyn/scripts/factorio-api.lua @@ -48,7 +48,7 @@ function se_get_space_elevator_name(cache, surface) end if not entity or not entity.valid then - --Chaching failed, default to expensive lookup + --Caching failed, default to expensive lookup entity = surface.find_entities_filtered({ name = SE_ELEVATOR_STOP_PROTO_NAME, type = "train-stop", diff --git a/cybersyn/scripts/main.lua b/cybersyn/scripts/main.lua index ce6b93aa..978893d8 100644 --- a/cybersyn/scripts/main.lua +++ b/cybersyn/scripts/main.lua @@ -849,7 +849,7 @@ local function register_tick() script.on_nth_tick(nil) --edge case catch to register both main and manager tick if they're scheduled to run on the same ticks if mod_settings.manager_enabled and mod_settings.manager_ups == mod_settings.tps and mod_settings.tps > DELTA then - local nth_tick = ceil(60/mod_settings.tps) + local nth_tick = ceil(60/mod_settings.tps)--[[@as uint]] script.on_nth_tick(nth_tick, function() tick(global, mod_settings) manager.tick(global) From 25856782f79e4130f471334d6e652cd9b256f324 Mon Sep 17 00:00:00 2001 From: mamoniot Date: Sun, 14 May 2023 13:06:16 -0400 Subject: [PATCH 2/5] nullius compat --- cybersyn/data-final-fixes.lua | 37 +++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/cybersyn/data-final-fixes.lua b/cybersyn/data-final-fixes.lua index 940be260..0d4efb4e 100644 --- a/cybersyn/data-final-fixes.lua +++ b/cybersyn/data-final-fixes.lua @@ -11,20 +11,31 @@ if mods["nullius"] then table.insert(data.raw.technology["nullius-broadcasting-1"].prerequisites, "cybersyn-train-network") end --- Reset the combinator recipe back to arithmetic combinator recipe in case a mod has changed it -local recipe = flib.deep_copy(data.raw["recipe"]["arithmetic-combinator"].ingredients) -for k, _ in pairs(recipe) do - local mult = 2 - for i, _ in pairs(recipe) do - if recipe[k][i] == "copper-cable" then - mult = 4 - break; + +if mods["nullius"] then + --Credit to modo-lv for submitting the following code + -- Place combinator in the same subgroup as the regular train stop + data.raw["recipe"][COMBINATOR_NAME].subgroup = data.raw["train-stop"]["train-stop"].subgroup + data.raw["item"][COMBINATOR_NAME].subgroup = data.raw["item"]["train-stop"].subgroup + -- Nullius makes modded technologies part of its research tree + -- Place combinator in the same place on the research tree as LTN + table.insert(data.raw.technology["nullius-broadcasting-1"].prerequisites, "cybersyn-train-network") +else + -- Reset the combinator recipe back to arithmetic combinator recipe in case a mod has changed it + local recipe = flib.deep_copy(data.raw["recipe"]["arithmetic-combinator"].ingredients) + for k, _ in pairs(recipe) do + local mult = 2 + for i, _ in pairs(recipe) do + if recipe[k][i] == "copper-cable" then + mult = 4 + break; + end end - end - for i, _ in pairs(recipe) do - if type(recipe[k][i]) == "number" then - recipe[k][i] = mult*recipe[k][i] + for i, _ in pairs(recipe) do + if type(recipe[k][i]) == "number" then + recipe[k][i] = mult*recipe[k][i] + end end end + data.raw["recipe"][COMBINATOR_NAME].ingredients = recipe end -data.raw["recipe"][COMBINATOR_NAME].ingredients = recipe From 5c780f6c9981163793a8eaf7341881bc3deb3c0b Mon Sep 17 00:00:00 2001 From: mamoniot Date: Sun, 14 May 2023 13:07:49 -0400 Subject: [PATCH 3/5] fixed nullius compat --- cybersyn/data-final-fixes.lua | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/cybersyn/data-final-fixes.lua b/cybersyn/data-final-fixes.lua index 0d4efb4e..5d5037c8 100644 --- a/cybersyn/data-final-fixes.lua +++ b/cybersyn/data-final-fixes.lua @@ -1,25 +1,14 @@ flib = require("__flib__.table") require('scripts.constants') ---Credit to modo-lv for submitting the following code if mods["nullius"] then + -- Credit to modo-lv for submitting the following code -- Place combinator in the same subgroup as the regular train stop data.raw["recipe"][COMBINATOR_NAME].subgroup = data.raw["train-stop"]["train-stop"].subgroup data.raw["item"][COMBINATOR_NAME].subgroup = data.raw["item"]["train-stop"].subgroup -- Nullius makes modded technologies part of its research tree -- Place combinator in the same place on the research tree as LTN table.insert(data.raw.technology["nullius-broadcasting-1"].prerequisites, "cybersyn-train-network") -end - - -if mods["nullius"] then - --Credit to modo-lv for submitting the following code - -- Place combinator in the same subgroup as the regular train stop - data.raw["recipe"][COMBINATOR_NAME].subgroup = data.raw["train-stop"]["train-stop"].subgroup - data.raw["item"][COMBINATOR_NAME].subgroup = data.raw["item"]["train-stop"].subgroup - -- Nullius makes modded technologies part of its research tree - -- Place combinator in the same place on the research tree as LTN - table.insert(data.raw.technology["nullius-broadcasting-1"].prerequisites, "cybersyn-train-network") else -- Reset the combinator recipe back to arithmetic combinator recipe in case a mod has changed it local recipe = flib.deep_copy(data.raw["recipe"]["arithmetic-combinator"].ingredients) From c4eb0a6d405435e37c1bdfa11fe8c540e909d81f Mon Sep 17 00:00:00 2001 From: mamoniot Date: Sun, 14 May 2023 13:15:57 -0400 Subject: [PATCH 4/5] updated version --- cybersyn/changelog.txt | 10 +++++++++- cybersyn/data-final-fixes.lua | 18 ------------------ cybersyn/info.json | 2 +- cybersyn/scripts/migrations.lua | 21 ++++++++++++--------- 4 files changed, 22 insertions(+), 29 deletions(-) diff --git a/cybersyn/changelog.txt b/cybersyn/changelog.txt index 6041ef75..5a514ba6 100644 --- a/cybersyn/changelog.txt +++ b/cybersyn/changelog.txt @@ -1,4 +1,13 @@ --------------------------------------------------------------------------------------------------- +Version: 1.2.16 +Date: 2023-5-14 + Bugfixes: + - Fixed Nullius recipe being broken again + Translation: + - Chinese language update contributed by luaotix + - Russian language correction contributed by Eldrinn-Elantey + - Korean language contributed by manmen-mi +--------------------------------------------------------------------------------------------------- Version: 1.2.15 Date: 2023-4-30 Bugfixes: @@ -12,7 +21,6 @@ Date: 2023-4-30 Features: - Added opt-in WIP trains, inventory, and station manager gui (highly experimental, use at your own risk) Changes: - - Improved the recipe derivation logic for the cybernetic combinator, in all modpacks it should now consistently be about as difficult to craft as an arthmetic combinator. Vanilla recipe is unchanged, but several overhaul mods will receive new recipes. - The automatic allow list now consistently looks 3 tiles down the first curved rail it finds along a station for inserters or pumps. Previously it would conditionally look only 1 tile down. This should lead to more intuitive allow list behaviour for stations with trains that park slightly on curved rails. Bugfixes: - Provider override thresholds now correctly override the required train capacity as well; fix contributed by shopt diff --git a/cybersyn/data-final-fixes.lua b/cybersyn/data-final-fixes.lua index 5d5037c8..c16f8535 100644 --- a/cybersyn/data-final-fixes.lua +++ b/cybersyn/data-final-fixes.lua @@ -9,22 +9,4 @@ if mods["nullius"] then -- Nullius makes modded technologies part of its research tree -- Place combinator in the same place on the research tree as LTN table.insert(data.raw.technology["nullius-broadcasting-1"].prerequisites, "cybersyn-train-network") -else - -- Reset the combinator recipe back to arithmetic combinator recipe in case a mod has changed it - local recipe = flib.deep_copy(data.raw["recipe"]["arithmetic-combinator"].ingredients) - for k, _ in pairs(recipe) do - local mult = 2 - for i, _ in pairs(recipe) do - if recipe[k][i] == "copper-cable" then - mult = 4 - break; - end - end - for i, _ in pairs(recipe) do - if type(recipe[k][i]) == "number" then - recipe[k][i] = mult*recipe[k][i] - end - end - end - data.raw["recipe"][COMBINATOR_NAME].ingredients = recipe end diff --git a/cybersyn/info.json b/cybersyn/info.json index 06ebe558..739a874d 100644 --- a/cybersyn/info.json +++ b/cybersyn/info.json @@ -1,6 +1,6 @@ { "name": "cybersyn", - "version": "1.2.15", + "version": "1.2.16", "title": "Project Cybersyn", "author": "Mami", "factorio_version": "1.1", diff --git a/cybersyn/scripts/migrations.lua b/cybersyn/scripts/migrations.lua index 51d406a9..108688b4 100644 --- a/cybersyn/scripts/migrations.lua +++ b/cybersyn/scripts/migrations.lua @@ -300,15 +300,6 @@ local migrations_table = { ---@type MapData local map_data = global - if not global.manager then - global.manager = { - players = {}, - } - for i, v in pairs(game.players) do - manager_gui.on_player_created({player_index = i}) - end - end - for _, e in pairs(map_data.refuelers) do if e.network_flag then e.network_mask = e.network_flag @@ -328,6 +319,18 @@ local migrations_table = { end end end, + ["1.2.16"] = function() + ---@type MapData + local map_data = global + if not map_data.manager then + map_data.manager = { + players = {}, + } + for i, v in pairs(game.players) do + manager_gui.on_player_created({player_index = i}) + end + end + end } --STATUS_R_TO_D = 5 ---@param data ConfigurationChangedData From 078837e4531d12033999923b9af52ac317e1247f Mon Sep 17 00:00:00 2001 From: mamoniot Date: Sun, 14 May 2023 13:19:01 -0400 Subject: [PATCH 5/5] updated changelog --- cybersyn/changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/cybersyn/changelog.txt b/cybersyn/changelog.txt index 5a514ba6..670de340 100644 --- a/cybersyn/changelog.txt +++ b/cybersyn/changelog.txt @@ -3,6 +3,7 @@ Version: 1.2.16 Date: 2023-5-14 Bugfixes: - Fixed Nullius recipe being broken again + - Reran manager migrations to fix some people's worlds that used the beta branch Translation: - Chinese language update contributed by luaotix - Russian language correction contributed by Eldrinn-Elantey