This commit is contained in:
2026-05-09 22:00:33 +09:00
parent 1f5234e02e
commit 84c65f6eeb
+10 -26
View File
@@ -38,19 +38,7 @@ function main.gui_create(player)
end end
function main.gui_update(player, entity) function main.gui_update(player, entity)
if not entity.valid then if not entity.valid or not entity.type or entity.type ~= 'constant-combinator' or entity.name ~= 'super-combinator' then
return
end
if not entity.type then
return
end
if entity.type ~= 'constant-combinator' then
return
end
if entity.name ~= 'super-combinator' then
return return
end end
@@ -69,15 +57,7 @@ function main.gui_update(player, entity)
local val = cs1.min or 0 local val = cs1.min or 0
if not player.gui.relative.phi_cl_combinator_config then if not player.gui.relative.phi_cl_combinator_config or not player.gui.relative.phi_cl_combinator_config['default'] or not player.gui.relative.phi_cl_combinator_config['default']['table_research_queue'] then
return
end
if not player.gui.relative.phi_cl_combinator_config['default'] then
return
end
if not player.gui.relative.phi_cl_combinator_config['default']['table_research_queue'] then
return return
end end
@@ -167,7 +147,10 @@ function main.handle_research_queue(entity, combinator)
end end
function main.on_nth_tick_1800() function main.on_nth_tick_1800()
if storage.phi_cl and storage.phi_cl.loop and storage.phi_cl.loop.combinator and game.forces['player'] then if not storage.phi_cl or not storage.phi_cl.loop or not storage.phi_cl.loop.combinator or not game.forces['player'] then
return
end
storage.phi_cl.combinator.research_progress = math.floor(game.forces['player'].research_progress * 1000) storage.phi_cl.combinator.research_progress = math.floor(game.forces['player'].research_progress * 1000)
storage.phi_cl.combinator.combinator_list = {} storage.phi_cl.combinator.combinator_list = {}
storage.phi_cl.combinator.research_queue = {} storage.phi_cl.combinator.research_queue = {}
@@ -182,7 +165,10 @@ function main.on_nth_tick_1800()
n = n + 1 n = n + 1
end end
if prototypes.entity['super-combinator'] then if not prototypes.entity['super-combinator'] then
return
end
for _, s in pairs(game.surfaces) do for _, s in pairs(game.surfaces) do
local c = s.find_entities_filtered{type='constant-combinator', name='super-combinator'} local c = s.find_entities_filtered{type='constant-combinator', name='super-combinator'}
@@ -192,8 +178,6 @@ function main.on_nth_tick_1800()
end end
end end
end end
end
end
end end
function main.on_nth_tick_10() function main.on_nth_tick_10()