Heya,
Seems to be caused by overhaul.lua.
local function add_to_recipe(recipe, item, item_amount)
if not data.raw.recipe[recipe] then
return
end
if data.raw.recipe[recipe].ingredients then
table.insert(data.raw.recipe[recipe].ingredients, {type="item", name=item, amount=item_amount})
end
if data.raw.recipe[recipe].normal and data.raw.recipe[recipe].expensive then
table.insert(data.raw.recipe[recipe].normal.ingredients, {type="item", name=item, amount=item_amount})
table.insert(data.raw.recipe[recipe].expensive.ingredients, {type="item", name=item, amount=item_amount})
end
end
local function add_to_recipes(table_in)
--table structure: {{recipe, item, item_amount}, ... , ...}
for i,v in pairs(table_in) do
add_to_recipe(table_in[i].recipe, table_in[i].item, table_in[i].item_amount)
end
end
I'll look closer at this laters. Edit: Alrighty, I've fixed it, it seems. Further testing may be required. The following code lets the game load.
local function ingredient_exists( ingredient_list, ingredient_name )
local result = false
for _,ingredient in pairs(ingredient_list) do
if ingredient.name == ingredient_name then result = true; break; end
end
return result
end
local function add_ingredient_safely( ingredient_list, ingredient )
if not ingredient_exists( ingredient_list, ingredient.name ) then
table.insert( ingredient_list, ingredient )
end
end
local function add_to_recipe(recipe, item, item_amount)
if not data.raw.recipe[recipe] then
return
end
if data.raw.recipe[recipe].ingredients then
add_ingredient_safely(data.raw.recipe[recipe].ingredients, {type="item", name=item, amount=item_amount})
end
if data.raw.recipe[recipe].normal and data.raw.recipe[recipe].expensive then
add_ingredient_safely(data.raw.recipe[recipe].normal.ingredients, {type="item", name=item, amount=item_amount})
add_ingredient_safely(data.raw.recipe[recipe].expensive.ingredients, {type="item", name=item, amount=item_amount})
end
end
Best Regards,