From 33cda319017d40d69829b0810dac37b188114f81 Mon Sep 17 00:00:00 2001 From: danielmartin0 Date: Mon, 23 Sep 2024 14:08:47 +0100 Subject: [PATCH] reenable prod modules --- maps/pirates/api_on_tick.lua | 39 +++++++++++++++++------------------- maps/pirates/common.lua | 6 +++--- maps/pirates/crew.lua | 5 +++-- 3 files changed, 24 insertions(+), 26 deletions(-) diff --git a/maps/pirates/api_on_tick.lua b/maps/pirates/api_on_tick.lua index d1c2cc55..64baa6be 100644 --- a/maps/pirates/api_on_tick.lua +++ b/maps/pirates/api_on_tick.lua @@ -80,20 +80,20 @@ function Public.prevent_unbarreling_off_ship(tickinterval) end end -local function remove_productivity_modules(surface, machines) - for _, machine in ipairs(machines) do - if machine and machine.valid then - local modules = machine.get_module_inventory() - if modules and modules.valid then - local productivity_modules = modules.get_contents()['productivity-module'] - if productivity_modules and productivity_modules > 0 then - modules.remove { name = 'productivity-module', count = productivity_modules } - surface.spill_item_stack(machine.position, { name = 'productivity-module', count = productivity_modules }, true, nil, true) - end - end - end - end -end +-- local function remove_productivity_modules(surface, machines) +-- for _, machine in ipairs(machines) do +-- if machine and machine.valid then +-- local modules = machine.get_module_inventory() +-- if modules and modules.valid then +-- local productivity_modules = modules.get_contents()['productivity-module'] +-- if productivity_modules and productivity_modules > 0 then +-- modules.remove { name = 'productivity-module', count = productivity_modules } +-- surface.spill_item_stack(machine.position, { name = 'productivity-module', count = productivity_modules }, true, nil, true) +-- end +-- end +-- end +-- end +-- end function Public.apply_restrictions_to_machines(tickinterval) local memory = Memory.get_crew_memory() @@ -165,10 +165,10 @@ function Public.apply_restrictions_to_machines(tickinterval) type = { 'assembling-machine', 'furnace', 'lab' }, force = memory.force_name } - local drills = surface.find_entities_filtered { - type = { 'mining-drill' }, - force = memory.force_name - } + -- local drills = surface.find_entities_filtered { + -- type = { 'mining-drill' }, + -- force = memory.force_name + -- } local power_machines = surface.find_entities_filtered { type = { 'generator', 'solar-panel', 'boiler', 'reactor' }, force = memory.force_name @@ -184,9 +184,6 @@ function Public.apply_restrictions_to_machines(tickinterval) machine.active = not memory.crafters_disabled end end - - remove_productivity_modules(surface, crafters) - remove_productivity_modules(surface, drills) end end diff --git a/maps/pirates/common.lua b/maps/pirates/common.lua index d19bb2b9..5bebea2c 100644 --- a/maps/pirates/common.lua +++ b/maps/pirates/common.lua @@ -1696,9 +1696,9 @@ function Public.get_item_blacklist(tier) -- blacklist['cannon-shell'] = true -- blacklist['explosive-cannon-shell'] = true -- blacklist['speed-module-3'] = true - blacklist['productivity-module'] = true - blacklist['productivity-module-2'] = true - blacklist['productivity-module-3'] = true + -- blacklist['productivity-module'] = true + -- blacklist['productivity-module-2'] = true + -- blacklist['productivity-module-3'] = true -- blacklist['effectivity-module-3'] = true -- blacklist['space-science-pack'] = true -- blacklist['rocket-control-unit'] = true diff --git a/maps/pirates/crew.lua b/maps/pirates/crew.lua index 41b9e52d..65114413 100644 --- a/maps/pirates/crew.lua +++ b/maps/pirates/crew.lua @@ -1057,8 +1057,9 @@ function Public.reset_crew_and_enemy_force(id) crew_force.technologies['gate'].enabled = true -- crew_force.technologies['productivity-module'].enabled = false - crew_force.technologies['productivity-module-2'].enabled = false - crew_force.technologies['productivity-module-3'].enabled = false + -- crew_force.technologies['productivity-module-2'].enabled = false + -- crew_force.technologies['productivity-module-3'].enabled = false + -- crew_force.technologies['speed-module'].enabled = true -- crew_force.technologies['speed-module-2'].enabled = false -- crew_force.technologies['speed-module-3'].enabled = false