This commit is contained in:
Brevven 2021-05-31 14:19:36 -07:00
parent bb3b213f1a
commit afa282a556
4 changed files with 14 additions and 5 deletions

View file

@ -1,4 +1,9 @@
---------------------------------------------------------------------------------------------------
Version: 0.4.6
Date: 2021-05-23
Features:
- Nuclear furnace, mega furnace compat
---------------------------------------------------------------------------------------------------
Version: 0.4.5
Date: 2021-05-22
Fixes:

View file

@ -1,6 +1,6 @@
{
"name": "bzlead",
"version": "0.4.5",
"version": "0.4.6",
"factorio_version": "1.1",
"title": "Lead",
"author": "Brevven",

View file

@ -98,3 +98,11 @@ util.add_ingredient("kr-heavy-machine-gun-turret", "lead-plate", 10)
-- Geothermal
util.add_ingredient("geothermal-well", "lead-plate", 120)
-- Nuclear furnace
util.add_ingredient("nuclear-furnace-1", "lead-plate", 200)
util.add_ingredient("nuclear-furnace-2", "lead-plate", 200)
-- Mega furnace
util.add_ingredient("mega-furnace", "lead-plate", 5)

View file

@ -75,9 +75,7 @@ end
function replace_ingredient(recipe, old, new)
if recipe ~= nil and recipe.ingredients ~= nil then
for i, ingredient in pairs(recipe.ingredients) do
-- For final fixes
if ingredient.name == old then ingredient.name = new end
-- For updates
if ingredient[1] == old then ingredient[1] = new end
end
end
@ -120,11 +118,9 @@ end
function replace_some_ingredient(recipe, old, new, amount)
if recipe ~= nil and recipe.ingredients ~= nil then
for i, ingredient in pairs(recipe.ingredients) do
-- For final fixes
if ingredient.name == old then
ingredient.amount = math.max(1, ingredient.amount - amount)
end
-- For updates
if ingredient[1] == old then
ingredient[2] = math.max(1, ingredient[2] - amount)
end