BUG
Posted: Tue Dec 10, 2024 2:48 am
I have this bug that I just don't understand.
I have this code here that loops through a tile's inputs (other tiles that are inputs to that tile) and it disconnects the wire that are between them.
(A wire is just when tile A is in tile B's inputs and tile B is in tile A's outputs or vise versa)
Now here is the problem, whenever it originally prints the length of the tile.inputs table (at the top) it says two. Then whenever it prints the length of the tile.inputs table (in the loop) it says one. Though the loop does not continue after that. Whenever I comment the self:disconnectWire(tile, v, true) line, the loop continues fine. Though it should happen even when it is not commented because there is still one instance left in the table.
Does anybody have an idea?
I have this code here that loops through a tile's inputs (other tiles that are inputs to that tile) and it disconnects the wire that are between them.
(A wire is just when tile A is in tile B's inputs and tile B is in tile A's outputs or vise versa)
Code: Select all
print(#tile.inputs)
for i, v in pairs(tile.inputs) do
self:disconnectWire(tile, v, true)
print(#tile.inputs)
end
Does anybody have an idea?