Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions script/entity_processor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -360,15 +360,18 @@ end)
script.on_event(ev.on_player_selected_area, function(event)
if event.item ~= "ctron-selection-tool" then return end
local surface_index = event.surface.index
local force = game.players[event.player_index].force
for _, entity in pairs(event.entities) do
if entity and entity.valid then
if entity.type == 'entity-ghost' or entity.type == 'tile-ghost' or entity.type == 'item-request-proxy' then
entity_proc.create_chunk(entity, storage.construction_queue[surface_index], surface_index, true)
end
end
end
for _, entity in pairs(event.surface.find_entities_filtered{area=event.area, type='item-request-proxy'}) do
entity_proc.create_chunk(entity, storage.construction_queue[surface_index], surface_index, true)
for _, entity in pairs(event.surface.find_entities_filtered{area=event.area, force=force}) do
if entity.type == 'item-request-proxy' or entity.to_be_upgraded() then
entity_proc.create_chunk(entity, storage.construction_queue[surface_index], surface_index, true)
end
end
end)

Expand Down