diff --git a/changelog.txt b/changelog.txt index 92fd05c..0621323 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,9 @@ --------------------------------------------------------------------------------------------------- +Version: 0.3.7 +Date: 2021-02-15 + Changes: + - Loose compabitility with IR2 +--------------------------------------------------------------------------------------------------- Version: 0.3.6 Date: 2021-02-13 Changes: diff --git a/info.json b/info.json index bc6adb0..e3cb46c 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "bzsilicon", - "version": "0.3.6", + "version": "0.3.7", "factorio_version": "1.1", "title": "Silica & Silicon", "author": "Brevven", diff --git a/recipe-updates.lua b/recipe-updates.lua index a7f5822..f650e56 100644 --- a/recipe-updates.lua +++ b/recipe-updates.lua @@ -31,13 +31,18 @@ util.replace_ingredient("green-wire", "electronic-circuit", "silicon") util.replace_ingredient("red-wire", "copper-cable", "optical-fiber") util.replace_ingredient("red-wire", "electronic-circuit", "silicon") -util.add_ingredient("arithmetic-combinator", "silicon", 1); -util.add_ingredient("arithmetic-combinator", "optical-fiber", 1); -util.add_ingredient("constant-combinator", "silicon", 1); -util.add_ingredient("constant-combinator", "optical-fiber", 1); -util.add_ingredient("decider-combinator", "silicon", 1); -util.add_ingredient("decider-combinator", "optical-fiber", 1); -util.add_ingredient("programmable-speaker", "optical-fiber", 1); +if not mods["IndustrialRevolution"] then + util.add_ingredient("arithmetic-combinator", "silicon", 1) + util.add_ingredient("constant-combinator", "silicon", 1) + util.add_ingredient("decider-combinator", "silicon", 1) +else + util.add_prerequisite("circuit-network", "fiber-optics") +end + +util.add_ingredient("arithmetic-combinator", "optical-fiber", 1) +util.add_ingredient("constant-combinator", "optical-fiber", 1) +util.add_ingredient("decider-combinator", "optical-fiber", 1) +util.add_ingredient("programmable-speaker", "optical-fiber", 1) util.add_prerequisite("circuit-network", "fiber-optics") util.add_prerequisite("circuit-network", util.silicon_processing) diff --git a/util.lua b/util.lua index a469e0e..b731c6b 100644 --- a/util.lua +++ b/util.lua @@ -37,6 +37,11 @@ end function add_ingredient(recipe, ingredient, quantity) if recipe ~= nil and recipe.ingredients ~= nil then + for _, existing in ipairs(recipe.ingredients) do + if ingredient == existing.name or ingredient == existing[1] then + return + end + end table.insert(recipe.ingredients, {ingredient, quantity}) end end