This commit is contained in:
2025-12-16 00:22:06 +09:00
parent 700af03d87
commit 4fc0cda35b

View File

@@ -379,7 +379,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 = {} storage.phi_cl.combinator.research_queue_set = {}
-- todo, r and g should be a sum -- todo, r and g should be a sum
@@ -395,7 +395,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
tech_queue[i] = tech_name storage.phi_cl.combinator.research_queue_set[i] = tech_name
end end
end end
end end
@@ -404,18 +404,13 @@ local function handle_research_queue(entity, combinator)
end end
end end
storage.phi_cl.combinator.research_queue_set = {}
for i=1,7 do for i=1,7 do
if tech_queue[i] then if storage.phi_cl.combinator.research_queue_set[i] then
table.insert(storage.phi_cl.combinator.research_queue_set, tech_queue[i]) game.forces['player'].add_research(storage.phi_cl.combinator.research_queue_set[i])
end end
end end
if #storage.phi_cl.combinator.research_queue_set > 0 then storage.phi_cl.combinator.last_writer = nil
game.forces['player'].research_queue = storage.phi_cl.combinator.research_queue_set
storage.phi_cl.combinator.last_writer = nil
end
end end
end end