diff --git a/PHI-CL/control.lua b/PHI-CL/control.lua index f66b569..94f7fd2 100644 --- a/PHI-CL/control.lua +++ b/PHI-CL/control.lua @@ -137,17 +137,15 @@ local function entity_build(event) return end - if event.entity.type == 'cargo-landing-pad' and prototypes.entity['proxy-cargo-landing-pad'] then + if event.entity.type == 'proxy-cargo-landing-chest' then local ec = game.surfaces[1].find_entities_filtered{type='cargo-landing-pad'} - if #ec <= 1 then + if not ec then return end - local p = game.surfaces[1].create_entity{name = 'proxy-cargo-landing-pad', position = {event.entity.position.x, event.entity.position.y}, force = 'neutral', quality = event.entity.quality.name} - p.proxy_target_entity = ec[1] - p.proxy_target_inventory = defines.inventory.cargo_landing_pad_main - event.entity.destroy() + event.entity.proxy_target_entity = ec[1] + event.entity.proxy_target_inventory = defines.inventory.cargo_landing_pad_main return end diff --git a/PHI-CL/data.lua b/PHI-CL/data.lua index 0f70429..c3c2b44 100644 --- a/PHI-CL/data.lua +++ b/PHI-CL/data.lua @@ -1232,8 +1232,8 @@ if settings.startup['PHI-GM'].value and settings.startup['PHI-GM'].value == 'VP' data.raw['tool']['space-science-pack'].rocket_launch_products = {{type = 'item', name = 'raw-fish', amount = 1}} data.raw['tool']['space-science-pack'].send_to_orbit_mode = 'automated' - local item = table.deepcopy(data.raw['item']['cargo-landing-pad']) - item.name = 'proxy-cargo-landing-pad' + local item = table.deepcopy(data.raw['item']['steel-chest']) + item.name = 'proxy-cargo-landing-chest' item.place_result = item.name item.order = 'c[cargo-landing-pad]-2' item.icons = {{icon = item.icon or '__base__/graphics/icons/cargo-landing-pad.png', tint = items['tint'][8], icon_size = item.icon_size or 64, icon_mipmaps = item.icon_mipmaps or 4}} @@ -1246,12 +1246,10 @@ if settings.startup['PHI-GM'].value and settings.startup['PHI-GM'].value == 'VP' item.localised_description = {'entity-description.cargo-landing-pad'} data:extend({item}) - local entity = table.deepcopy(data.raw['cargo-landing-pad']['cargo-landing-pad']) + local entity = table.deepcopy(data.raw['container']['steel-chest']) entity.name = item.name - entity.minable.result = 'cargo-landing-pad' + entity.minable.result = item.name entity.type = 'proxy-container' - entity.trash_inventory_size = 0 - entity.picture = {layers = table.deepcopy(entity.graphics_set.picture)} entity.flags = {'placeable-player', 'player-creation', 'no-automated-item-insertion', 'hide-alt-info'} entity.localised_name = {'phi-cl.combine', {'entity-name.cargo-landing-pad'}, ' (II)'} entity.localised_description = {'entity-description.cargo-landing-pad'}