[0.16.39] ingredient_count not enforced universally
Posted: Wed May 02, 2018 9:44 am
It seems that the ingredient_count restriction on what recipes a machine can make is only enforced for some machines and/or categories.
Steps to reproduce: declare a recipe in the crafting category "chemistry" or in a new custom category with more ingredients that the corresponding machine is supposed to support by its ingredient_count definition, and the machine will still be able to craft the recipe.
Some examples.
Chemical plant has ingredient_count = 4, but will still craft this recipe, i.e. not enforced.
Centrifuge has ingredient_count = 2, and will NOT craft this recipe, i.e. properly enforced.
Assembling machine 1 has ingredient_count = 2 and will NOT craft this recipe, i.e. properly enforced.
Chemical plant has ingredient_count = 4, but will still craft this recipe, i.e. not enforced.
It also doesn't seem to be enforced for any custom assembling-machine definition.
So it seems the ingredient_count restriction is enforced for the assembling machines 1, 2 and 3, and the centrifuge, but not the chemical plant or any custom assemblers.
Steps to reproduce: declare a recipe in the crafting category "chemistry" or in a new custom category with more ingredients that the corresponding machine is supposed to support by its ingredient_count definition, and the machine will still be able to craft the recipe.
Some examples.
Code: Select all
data:extend({
{
type = "recipe",
name = "engine-unit2",
energy_required = 10,
category = "chemistry",
ingredients =
{
{"steel-plate", 1},
{"iron-gear-wheel", 1},
{"pipe", 2},
{"oil-refinery", 10},
{"iron-plate", 30}
},
result = "engine-unit",
enabled = true
}
})
Code: Select all
data:extend({
{
type = "recipe",
name = "engine-unit3",
energy_required = 10,
category = "centrifuging",
ingredients =
{
{"steel-plate", 1},
{"iron-gear-wheel", 1},
{"pipe", 2},
{"oil-refinery", 10},
{"iron-plate", 30}
},
result = "engine-unit",
enabled = true
}
})
Code: Select all
data:extend({
{
type = "recipe",
name = "engine-unit4",
energy_required = 10,
category = "customing",
ingredients =
{
{"steel-plate", 1},
{"iron-gear-wheel", 1},
{"pipe", 2},
{"oil-refinery", 10},
{"iron-plate", 30}
},
result = "engine-unit",
enabled = true
},
{
type = "recipe-category",
name = "customing"
}})
data.raw["assembling-machine"]["assembling-machine-1"].crafting_categories = {"customing"}
Assembling machine 1 has ingredient_count = 2 and will NOT craft this recipe, i.e. properly enforced.
Code: Select all
data:extend({
{
type = "recipe",
name = "engine-unit5",
energy_required = 10,
category = "customing",
ingredients =
{
{"steel-plate", 1},
{"iron-gear-wheel", 1},
{"pipe", 2},
{"oil-refinery", 10},
{"iron-plate", 30}
},
result = "engine-unit",
enabled = true
},
{
type = "recipe-category",
name = "customing"
}})
data.raw["assembling-machine"]["chemical-plant"].crafting_categories = {"customing"}
Chemical plant has ingredient_count = 4, but will still craft this recipe, i.e. not enforced.
It also doesn't seem to be enforced for any custom assembling-machine definition.
So it seems the ingredient_count restriction is enforced for the assembling machines 1, 2 and 3, and the centrifuge, but not the chemical plant or any custom assemblers.