fivem-busdriver
fivem-busdriver copied to clipboard
table remove inside for loop
hello, first of all excellent resource. I wanted to point out these 2 reported functions which probably does not work as intended,
https://github.com/Lachee/fivem-busdriver/blob/0a7e32d2525b767a1092935196d444d4a005ba25/client/entities/Bus.lua#L135-L180
you are using the table.remove inside a loop, but table.remove cause the elements in the table to be shifted immediately after deletion, so you are not looping every element in the table but skipping 1 after every remove.