attempt fix

This commit is contained in:
Brevven 2022-07-05 19:02:26 -07:00
parent bdce031209
commit 6327eb1db1
3 changed files with 13 additions and 1 deletions

View file

@ -1,4 +1,9 @@
---------------------------------------------------------------------------------------------------
Version: 0.2.2
Date: 2022-07-06
Fixes:
- Attempt to fix an issue with duplicate ingredients in refractory recipes
---------------------------------------------------------------------------------------------------
Version: 0.2.1
Date: 2022-07-05
Changes:

View file

@ -1,6 +1,6 @@
{
"name": "bzfoundry",
"version": "0.2.1",
"version": "0.2.2",
"factorio_version": "1.1",
"title": "Foundry",
"author": "Brevven",

View file

@ -176,8 +176,15 @@ function make_ingredients_and_products(r, name)
if refractory_amount > 25 then refractory_amount = refractory_amount / 25 end
end
for i, refractory in pairs(refractories) do
for j, existing in pairs(r.ingredients) do
if existing[1] == refractory or existing.name == refractory then
log("Warning: "..name.." refractory recipe recipe unbalanced due to skipped ingredients")
goto skip
end
end
table.insert(r.ingredients, {refractory, refractory_amount})
end
::skip::
for i, result in pairs(r.results) do
if result[1] and check_name(result[1]) then