loose ir2 compatibility

This commit is contained in:
Brevven 2021-02-15 03:37:20 -08:00
parent 2fb14a0438
commit 8a03a3e487
4 changed files with 23 additions and 8 deletions

View file

@ -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:

View file

@ -1,6 +1,6 @@
{
"name": "bzsilicon",
"version": "0.3.6",
"version": "0.3.7",
"factorio_version": "1.1",
"title": "Silica & Silicon",
"author": "Brevven",

View file

@ -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)

View file

@ -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