This bug has been killing me all day. Couldn’t figure it out in the event graph so I colored all the plates:
Looks like some tiles aren’t being added to a plate(the grey colorless tiles), which is creating the extra arrays I am seeing. I considered that but still didn’t see it in the 1-2 functions responsible. Hopefully I can quickly finish this thing off in the morning.
There may be a deep flaw in the way I am running this function though. I have an Array I call the “Open List” which I add one tile index to. Then, I ForEachLoop that array and in doing so add new indexes to the Open List. Theoretically this should happen before the next item in Open List is called, which it seems to do… but perhaps it doesn’t always succeed? Maybe it hits the end of the Open List before an item gets fully added and drops the loop? Anyone have any experience with something like this?
I am basically walking each plate, marking that plate as good, and ignoring it while I walk the next plate. I think some tiles may be getting lost in this process.