can someone explain me why this is not working :
Code: Select all
tab= {}
for _, ent in pairs(surface.find_entities_filtered{area=a, type="assembling-machine"}) do
tab[ent] = {m=1, n=2 } -- i create a table indexed by entities
end
for _, ent in pairs(surface.find_entities_filtered{area=a, type="assembling-machine"}) do -- then I try to access this table I created before
local ref = tab[ent]
-- here, ref contains nil : it does not point to the object I created in the previous loop!
end