mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 11:35:22 +09:00
Merge pull request #257 from PHIDIAS0303/dev5
fixed non prod module insertion with recipe
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
return {
|
return {
|
||||||
-- type of machine to handle together
|
-- type of machine to handle together
|
||||||
default_module_row_count = 4,
|
default_module_row_count = 6,
|
||||||
module_slot_max = 4,
|
module_slot_max = 4,
|
||||||
machine_prod_disallow = {
|
machine_prod_disallow = {
|
||||||
['beacon'] = true
|
['beacon'] = true
|
||||||
|
|||||||
@@ -67,21 +67,36 @@ local function clear_module(player, area, machine)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function apply_module(player, area, machine, module)
|
local function apply_module(player, area, machine, modules)
|
||||||
for _, entity in pairs(player.surface.find_entities_filtered{area=area, name=machine, force=player.force}) do
|
for _, entity in pairs(player.surface.find_entities_filtered{area=area, name=machine, force=player.force}) do
|
||||||
if config.machine_craft[machine] then
|
if config.machine_craft[machine] then
|
||||||
local m_current_recipe = entity.get_recipe()
|
local m_current_recipe = entity.get_recipe()
|
||||||
|
|
||||||
if m_current_recipe ~= nil then
|
if m_current_recipe ~= nil then
|
||||||
if config.module_allowed[m_current_recipe.name] then
|
if config.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
|
entity.surface.create_entity{name='item-request-proxy', target=entity, position=entity.position, force=entity.force, modules=modules}
|
||||||
|
entity.last_user = player
|
||||||
|
|
||||||
|
else
|
||||||
|
for k in pairs(modules) do
|
||||||
|
if k:find('productivity') then
|
||||||
|
modules[k:gsub('productivity', 'effectivity')] = modules[k]
|
||||||
|
modules[k] = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
entity.surface.create_entity{name='item-request-proxy', target=entity, position=entity.position, force=entity.force, modules=modules}
|
||||||
|
entity.last_user = player
|
||||||
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
entity.surface.create_entity{name='item-request-proxy', target=entity, position=entity.position, force=entity.force, modules=module}
|
entity.surface.create_entity{name='item-request-proxy', target=entity, position=entity.position, force=entity.force, modules=modules}
|
||||||
|
entity.last_user = player
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
entity.surface.create_entity{name='item-request-proxy', target=entity, position=entity.position, force=entity.force, modules=module}
|
entity.surface.create_entity{name='item-request-proxy', target=entity, position=entity.position, force=entity.force, modules=modules}
|
||||||
|
entity.last_user = player
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user