mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 11:35:22 +09:00
fix no recipe module insertion
This commit is contained in:
@@ -5,6 +5,15 @@ return {
|
||||
machine_prod_disallow = {
|
||||
['beacon'] = true
|
||||
},
|
||||
machine_craft = {
|
||||
['assembling-machine-2'] = true,
|
||||
['assembling-machine-3'] = true,
|
||||
['electric-furnace'] = true,
|
||||
['oil-refinery'] = true,
|
||||
['chemical-plant'] = true,
|
||||
['centrifuge'] = true,
|
||||
['rocket-silo'] = true
|
||||
},
|
||||
machine = {
|
||||
['electric-mining-drill'] = 'effectivity-module',
|
||||
['assembling-machine-2'] = 'productivity-module',
|
||||
|
||||
@@ -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
|
||||
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
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user