From 6327eb1db1b30dfa803ed0d68ffdc248ba39d070 Mon Sep 17 00:00:00 2001 From: Brevven Date: Tue, 5 Jul 2022 19:02:26 -0700 Subject: [PATCH] attempt fix --- changelog.txt | 5 +++++ info.json | 2 +- refractory-updates.lua | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index 31f29fb..26ea905 100644 --- a/changelog.txt +++ b/changelog.txt @@ -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: diff --git a/info.json b/info.json index 54051c4..71768f3 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "bzfoundry", - "version": "0.2.1", + "version": "0.2.2", "factorio_version": "1.1", "title": "Foundry", "author": "Brevven", diff --git a/refractory-updates.lua b/refractory-updates.lua index b31df61..15fcdaf 100644 --- a/refractory-updates.lua +++ b/refractory-updates.lua @@ -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