Take these two examples:
Code: Select all
/c for k,v in pairs(game.players) do print(v.name) end
Code: Select all
/c for k,v in next, game.players do game.print(v.name) end
Upon further investigation i noticed that while pairs returns the expected table wrapper {__self=<userdata>}, next returns the <userdata> object without the table around it.
So my question is: Is this a bug? Am i just doing something stupid? Why does next work for normal tables but not for factorio rich objects?
Any help is appreciated.