Hello. There is such a function:
function s:checkpos(x, y) for _, o in pairs(self.objects) do if ox == x and oy == y then return o else return nil end end end where objects is a table with other tables with values under the keys x and y . The for loop for some reason does not go through all the elements of the table, but stops at the first one with coordinates 50, 50. At the same time, another function:
function s:update(dt) for _, o in pairs(self.objects) do if o.update then o:update(dt) end end end It works as it should, i.e. the update function is called for each table element, if it exists. Help please find a mistake!