mirror of
https://github.com/PHIDIAS0303/factorio-mod-PHI.git
synced 2026-05-12 21:08:43 +09:00
.
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user