fix no recipe module insertion

This commit is contained in:
2023-09-30 18:40:15 +09:00
parent 832ff0acef
commit 4015e5058a
2 changed files with 21 additions and 5 deletions

View File

@@ -123,15 +123,22 @@ end
local function apply_module(player, area, machine, module)
for _, entity in pairs(player.surface.find_entities_filtered{area=area, name=machine, force=player.force}) do
local m_current_recipe = entity.get_recipe()
if config.machine_craft[machine] ~= nil then
if config.machine_craft[machine] then
local m_current_recipe = entity.get_recipe()
-- insert
if m_current_recipe ~= nil then
if module_allowed[m_current_recipe.name] ~= nil then
if module_allowed[m_current_recipe.name] then
if m_current_recipe ~= nil then
if module_allowed[m_current_recipe.name] ~= nil then
if module_allowed[m_current_recipe.name] then
entity.surface.create_entity{name='item-request-proxy', target=entity, position=entity.position, force=entity.force, modules=module}
end
end
else
entity.surface.create_entity{name='item-request-proxy', target=entity, position=entity.position, force=entity.force, modules=module}
end
end
else
entity.surface.create_entity{name='item-request-proxy', target=entity, position=entity.position, force=entity.force, modules=module}
end