Currently to find these entities we have to find all entities then iterate them to filter the ones marked for upgrades:
Code: Select all
local entities = LuaLogisticsCell.owner.surface.find_entities{area=bounds, force=logsiticNetwork.force}
for _, e in pairs(entities) do
if e.to_be_upgraded() then
...
end
end
Rseding91 wrote:type filtering is dereferencing the entity pointer and calling a virtual function on it to get the type.
reading to_be_upgraded would be faster since it's a non-virtual function that just reads a bit mask.