Do not use table.remove() with large tables if you have a large amount of elements to removal. Copy elements which should not to be removed into new table, and then remove old table.
You are removing an element from a table and then continuing forwards (the second element becomes the first element, but you've already comepleted that iteration in your for loop).
Think of it like pulling steps out from a staircase, while you're climbing it. The obvious fix, then, is to walk down the staircase.
tentus wrote:You are removing an element from a table and then continuing forwards (the second element becomes the first element, but you've already comepleted that iteration in your for loop).
Think of it like pulling steps out from a staircase, while you're climbing it. The obvious fix, then, is to walk down the staircase.