From 1d3e9fffaf6d88981fa13bed2cd76db35d3d0dd4 Mon Sep 17 00:00:00 2001 From: Brevven Date: Fri, 19 Mar 2021 23:12:54 -0700 Subject: [PATCH] k2 wafer deadlock fix --- changelog.txt | 5 +++++ control.lua | 3 +++ info.json | 2 +- prototypes/silicon-recipe.lua | 2 ++ util.lua | 4 +++- 5 files changed, 14 insertions(+), 2 deletions(-) diff --git a/changelog.txt b/changelog.txt index fec785d..0c91e90 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,9 @@ --------------------------------------------------------------------------------------------------- +Version: 0.6.4 +Date: 2021-03-15 + Fixes: + - Fix tech deadlock in K2 with intermediates on (type SiliconRecipes) +--------------------------------------------------------------------------------------------------- Version: 0.6.3 Date: 2021-03-14 Features: diff --git a/control.lua b/control.lua index 0a1ac5f..9f5333c 100644 --- a/control.lua +++ b/control.lua @@ -7,6 +7,9 @@ script.on_event( defines.events.on_console_chat, function(event) if game.players[event.player_index].force.recipes["solar-cell"] then game.players[event.player_index].force.recipes["solar-cell"].enabled=true end + if game.players[event.player_index].force.recipes["hydrogen-chloride"] then + game.players[event.player_index].force.recipes["hydrogen-chloride"].enabled=true + end end end) diff --git a/info.json b/info.json index 30754f5..849446a 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "bzsilicon", - "version": "0.6.3", + "version": "0.6.4", "factorio_version": "1.1", "title": "Silica & Silicon", "author": "Brevven", diff --git a/prototypes/silicon-recipe.lua b/prototypes/silicon-recipe.lua index 05c4f09..ce9613d 100644 --- a/prototypes/silicon-recipe.lua +++ b/prototypes/silicon-recipe.lua @@ -139,4 +139,6 @@ data:extend({ result_count = 2, }, }) + +util.add_effect("kr-fluids-chemistry", {type="unlock-recipe", recipe="hydrogen-chloride"}) end diff --git a/util.lua b/util.lua index 59f6d63..f7e75bf 100644 --- a/util.lua +++ b/util.lua @@ -34,7 +34,9 @@ end -- Add a prerequisite to a given technology function util.add_prerequisite(technology_name, prerequisite) technology = data.raw.technology[technology_name] - table.insert(technology.prerequisites, prerequisite) + if technology then + table.insert(technology.prerequisites, prerequisite) + end end -- Add a given quantity of ingredient to a given recipe