So I'm working on this path finding system, and don't worry the problem isn't that complicated. All I'm trying do at the moment is compare values in a list (which is numerically ordered through the use of preceding zeros before the list data). Here's a little photo that I drew up that will explain some of the values in my engine.
On the left is the starting node. It's starting position is at (1,4). I wrote out the surrounding square coordinates. On the right is the list that's ordered by the "F values" for each square. Each line of the list represents data from a square. The first number is the F value, the next two numbers is that squares coordinates, and the final number is the corresponding index number for some other array (last part doesn't matter). Basically I'm testing for the lowest F value (which should be somewhere at the top of the list) however the square has to be adjacent to the previous square. I've stored the previous square's coordinates in two alterable values called "Parent X Val and "Parent Y Val".
So at the start of this fast loop on the first loop it will set the lowest number to an alterable value (Check F Val=40 as in the photo above). Then each loop it will compare the next line in the list. If the F values are the same it will compare the square's coordinates with the Parent X and Parent Y vals. I use the absolute value of the difference between the two values and compare it to either 0 or 1.
Here's a look at my code:
As you can see I added an "end application" action in this line, however it does not trigger. I made sure that the Parent X and Y values are correct and that the data is correct in the list. For some reason it's not triggering. Could anybody help me? I know this is kind of a long post and a bit complicated to explain, but it's really not that confusing... Thanks.