This commit is contained in:
2025-12-16 00:02:16 +09:00
parent b6034454d0
commit 46d4636e21

View File

@@ -386,6 +386,7 @@ local function handle_research_queue(entity, combinator)
end end
storage.phi_cl.combinator.last_writer = entity.unit_number storage.phi_cl.combinator.last_writer = entity.unit_number
local tech_queue = {}
for _, wire_type in pairs({defines.wire_type.red, defines.wire_type.green}) do for _, wire_type in pairs({defines.wire_type.red, defines.wire_type.green}) do
local network = entity.get_circuit_network(wire_type) local network = entity.get_circuit_network(wire_type)
@@ -399,7 +400,7 @@ local function handle_research_queue(entity, combinator)
for i=1, 7 do for i=1, 7 do
if math.floor(signal.count / (2 ^ (7 + i))) % 2 == 1 then if math.floor(signal.count / (2 ^ (7 + i))) % 2 == 1 then
storage.phi_cl.combinator.research_queue_set[i] = tech_name tech_queue[i] = tech_name
end end
end end
end end
@@ -408,19 +409,18 @@ local function handle_research_queue(entity, combinator)
end end
end end
local tech_queue = {} storage.phi_cl.combinator.research_queue_set = {}
for i=1,7 do for i=1,7 do
if storage.phi_cl.combinator.research_queue_set[i] then if tech_queue[i] then
table.insert(tech_queue, storage.phi_cl.combinator.research_queue_set[i]) table.insert(storage.phi_cl.combinator.research_queue_set, tech_queue[i])
end end
end end
if #tech_queue > 0 then if #storage.phi_cl.combinator.research_queue_set > 0 then
game.forces['player'].research_queue = tech_queue game.forces['player'].research_queue = storage.phi_cl.combinator.research_queue_set
storage.phi_cl.combinator.last_writer = nil
end end
storage.phi_cl.combinator.last_writer = nil
end end
end end