Code: Select all
local entities = player.surface.find_entities(area)
for index,entity in pairs(entities) do
if entity.to_be_deconstructed(player.force) or entity.type == "entity-ghost" or entity.type == "tile-ghost" then
...
end
end
Code: Select all
local entities = player.surface.find_entities_filtered{area = area, bot_constructible=true}
Side question, in https://www.factorio.com/blog/post/fff-256 I noticed:
Sounds like exactly what I want, but it sounds like making this list/query accessible would be exposing a bit too much of the implementation details.We did a similar improvement a while back with the personal Roboports, where they independently check for nearby ghosts, outside of the global (per force) construction queue.