From 76c19f1d530e9f2a5d42a7e3227b6d0b3ef7141b Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Mon, 6 Oct 2025 12:06:59 +0200 Subject: [PATCH] Fix some old 1.1 code --- data-util.lua | 16 ---------------- strange-matter.lua | 2 +- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/data-util.lua b/data-util.lua index e30ba66..bfcf550 100644 --- a/data-util.lua +++ b/data-util.lua @@ -993,8 +993,6 @@ function add_product(recipe, product) return end end - recipe.result = nil - recipe.result_count = nil table.insert(recipe.results, product) end end @@ -1119,7 +1117,6 @@ end function replace_some_product(recipe, old, old_amount, new, new_amount) if recipe ~= nil then - if recipe.result == new then return end if recipe.results then for i, existing in pairs(recipe.results) do if existing.name == new then @@ -1211,10 +1208,6 @@ function set_product_amount(recipe, product, amount) end end end - if not recipe.results and not recipe.result_count then - -- implicit one item result - recipe.result_count = amount - end end end @@ -1348,10 +1341,6 @@ function replace_product(recipe, old, new, options) if recipe.main_product == old then recipe.main_product = new end - if recipe.result == old then - recipe.result = new - return - end if recipe.results then for i, result in pairs(recipe.results) do if result.name == old then result.name = new end @@ -1611,10 +1600,6 @@ end function add_to_product(recipe, product, amount) if recipe ~= nil and recipe.results ~= nil then - if recipe.result == product then - recipe.result_count = recipe.result_count + amount - return - end for i, result in pairs(recipe.results) do if result.name == product then result.amount = result.amount + amount @@ -1823,7 +1808,6 @@ function util.sum_products(recipe_name) -- this is going to end up approximate in some cases, integer division is probs fine if data.raw.recipe[recipe_name] then local recipe = data.raw.recipe[recipe_name] - if not recipe.results then return recipe.result_count end local sum = 0 for i, result in pairs(recipe.results) do local amt = 0 diff --git a/strange-matter.lua b/strange-matter.lua index 529267f..450c8d7 100644 --- a/strange-matter.lua +++ b/strange-matter.lua @@ -16,7 +16,7 @@ data:extend({ enabled = false, energy_required = 1, ingredients = {{type="fluid", name="strange-matter", amount = 1}}, - result = ore, + results = {{ type = "item", name = ore, amount = 1 }}, category = "crafting-with-fluid", subgroup = "synthesis", },