(Sorry for asking so many questions over the past few days; I'm participating in a game jam and working on a pretty technically complex project for it by my standards)
Anyway, I am trying to write a function to find 'encircled' clusters of values in an array, and change their value. In this case, I want to find relatively small groups of spots in a array with the value 1 that are surrounded by 0 and change the group of 1s to 3s. There is absolutely no way I could possibly explain what I tried with screenshots, so I'll link the file below (the main code in question is in the Frontline group functions "FindEncirclements" and "FloodFillBlue").
I'm not sure if I just messed up one or two events, or if there is an entirely diffrent system that I should be using, but either way it would help a ton to have a fresh pair of eyes look at this.
https://drive.google.com/file/d/1fQeMQSXBY8Hs90i8WKGVr4unMTMIPDrA/view?usp=drive_link