up
This commit is contained in:
parent
b109fd2cd9
commit
c9dc300b14
1 changed files with 10 additions and 5 deletions
|
|
@ -457,14 +457,19 @@ function util.replace_product(recipe_name, old, new)
|
||||||
end
|
end
|
||||||
|
|
||||||
function replace_product(recipe, old, new)
|
function replace_product(recipe, old, new)
|
||||||
if recipe ~= nil and recipe.results ~= nil then
|
if recipe then
|
||||||
|
if recipe.main_product == old then
|
||||||
|
recipe.main_product = new
|
||||||
|
end
|
||||||
if recipe.result == old then
|
if recipe.result == old then
|
||||||
recipe.results = new
|
recipe.result = new
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
for i, result in pairs(recipe.results) do
|
if recipe.results then
|
||||||
if result.name == old then result.name = new end
|
for i, result in pairs(recipe.results) do
|
||||||
if result[1] == old then result[1] = new end
|
if result.name == old then result.name = new end
|
||||||
|
if result[1] == old then result[1] = new end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue