This commit is contained in:
2026-05-09 00:52:54 +09:00
parent 73ceb1b6dd
commit 3b9328e1ce
+6 -14
View File
@@ -1,16 +1,12 @@
local main = {} local main = {}
function main.build(event) function main.build(event)
if event.entity.type == 'proxy-container' then if event.entity.type == 'proxy-container' and event.entity.name == 'proxy-cargo-landing-chest' then
if event.entity.name ~= 'proxy-cargo-landing-chest' then
return
end
if not prototypes.entity['cargo-landing-pad'] then if not prototypes.entity['cargo-landing-pad'] then
return return
end end
local ec = game.surfaces[event.entity.surface].find_entities_filtered{type='cargo-landing-pad'} local ec = event.entity.surface.find_entities_filtered{type = 'cargo-landing-pad', name = 'cargo-landing-pad'}
if not ec then if not ec then
return return
@@ -19,22 +15,18 @@ function main.build(event)
event.entity.proxy_target_entity = ec[1] event.entity.proxy_target_entity = ec[1]
event.entity.proxy_target_inventory = defines.inventory.cargo_landing_pad_main event.entity.proxy_target_inventory = defines.inventory.cargo_landing_pad_main
elseif event.entity.type == 'cargo-landing-pad' then elseif event.entity.type == 'cargo-landing-pad' and event.entity.name == 'cargo-landing-pad' then
if event.entity.name ~= 'cargo-landing-pad' then
return
end
if not prototypes.entity['proxy-cargo-landing-chest'] then if not prototypes.entity['proxy-cargo-landing-chest'] then
return return
end end
local ec = game.surfaces[event.entity.surface].find_entities_filtered{type='cargo-landing-pad'} local ec = event.entity.surface.find_entities_filtered{type = 'cargo-landing-pad', name = 'cargo-landing-pad'}
if #ec > 1 then if ec and #ec > 1 then
return return
end end
local ep = game.surfaces[event.entity.surface].find_entities_filtered{type='proxy-container', name='proxy-cargo-landing-chest'} local ep = event.entity.surface.find_entities_filtered{type = 'proxy-container', name = 'proxy-cargo-landing-chest'}
if not ep then if not ep then
return return